Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a →...

55
1 Kaplan & Kay 5 - Finite-State Methods in Natural-Language Processing: Rewriting Rules Ronald M. Kaplan and Martin Kay

Transcript of Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a →...

Page 1: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

1Kaplan & Kay 5 -

Finite-State Methods inNatural-Language Processing:

Rewriting Rules

Ronald M. Kaplan

and

Martin Kay

Page 2: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

2Kaplan & Kay 5 -

Reference

• Chomsky, Noam. and Morris Halle. The SoundPattern of English. Harper Row, 1968

• Kenstowicz, Michael and Charles Kisseberth.Generative Phonology: Description and Theory.Academic Press, 1979

Page 3: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

3Kaplan & Kay 5 -

Spelling ConventionsN → m/ +labial

N → n

iN+tractable → intractable

iN+practical → impractical

iN is the common negative prefix— im before labial

— in otherwisec.f. input → input

Page 4: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

4Kaplan & Kay 5 -

Rewriting Rules

α → β / λ ρ

No rerewriting!ε → ab / a b

would map ab into anbn

α → β / λ ρ is not the same as λαρ → λβρ

Page 5: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

5Kaplan & Kay 5 -

An in/im Transducer

Page 6: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

6Kaplan & Kay 5 -

Ordered rules

try}# try}s# try}ed# try}ing#y->i/C_} tri}# tri}s# tri}ed# tri}ing#0->e/[i|sib]}_s# tri}# tri}es# tri}ed# tri}ing#e->0/_}e tri}# tri}es# tri}ed# tri}ing#i->y/_}[#, i] try}# tri}es# tri}ed# try}ing#

tie}# tie}s# tie}ed# tie}ing#y->i/C_} tie}# tie}s# tie}ed# tie}ing#0->e/[i|sib]}_s# tie}# tie}s# tie}ed tie}ing#e->0/_}e tie}# tie}es# ti}ed# ti}ing#i->y/_}[#, i] tie}# tie}es# ti}ed# ty}ing#

Page 7: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

7Kaplan & Kay 5 -

Feeding

tie}ing#tie}ing#tie}ing#ti}ing#ty}ing#

try}#y->i/C_} tri}#0->e/[i|sib]}_s# tri}#e->0/_}e tri}#i->y/_}[#, i] try}#

Page 8: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

8Kaplan & Kay 5 -

Application Direction—Examples

Gidabal

g u n u: m +b a: + d a: ng + b e: +

g u n u: m +b a + d a: ng + b e +

is certainly right on the stump

Slovak

v o l + a: v + a: m e:

v o l + a: v + a m e

we call often

V: → V / V: C*

left to right

right to leftor

simultaneous

Page 9: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

9Kaplan & Kay 5 -

Direction of Applicationa → b / ab ba

—Input

abababababa

—Output

abbbabbbaba (Left to right)

ababbbabbba (Right to left)

abbbbbbbbba (Simultaneous)

a → b / ab ba—Input

abababababa

—Output

abbbabbbaba (Left to right)

ababbbabbba (Right to left)

abbbbbbbbba (Simultaneous)

a b a b a b a b a b a

a b b b a b b b a b a

a b a b a b a b a b a

a b b b a b b b a b a

Left to right Right to Left

Page 10: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

10Kaplan & Kay 5 -

Optional Rules

a → x /b

abaca

abaca abxca

Page 11: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

11Kaplan & Kay 5 -

Special Operators• Intro(S) =df [Id(Σ) ∪ [{ε} × S]]∗

Strings of Σ* with members of the set S of symbols freelyintersperced. Intro-1(S) removes members of S if S and Σ aredisjoint.

• LS=df Range(Id(L) ° Intro(S)) IgnoreStrings that would be in L if some symbols in S were removed.

• If-P-then-S(L1, L2) =df {x1x2 | if x1 ∈ L1, then x2 ∈ L2} = L1L2

• If-S-then-P(L1, L2)

=L1L2 = If-P-then-S(L1, L2)• P-iff-S(L1, L2)=If-P-then-S(L1, L2) ∩

If-S-then-P(L1, L2)

Page 12: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

12Kaplan & Kay 5 -

Optional Replacement

α → β (optional)

Replace = [Id(Σ)* Opt(α×β)]*

where Opt(R) = R ∪ {<ε, ε>}

Page 13: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

13Kaplan & Kay 5 -

Context Restrictions—1

Replace = [Id(Σ)* Opt(Id(λ) α×β Ιd(ρ))]*

B → b / V VV B V B V V B V B V

V b V B V V b V b V

Accepts this but not this

... but both should be accepted

Page 14: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

14Kaplan & Kay 5 -

Context Restrictions—2

Put markers in the right placesReplace = [Id(Σ)* Opt(Id(<) αm×βm Ιd(>))]*

Remove markers

Xm is X with m’s freely interspersed

Page 15: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

15Kaplan & Kay 5 -

Left Context — 1Purpose: Eliminate brackets that are not precededby an instance of the left context.

LC(λ)=(Σ* λ <)* Σ*

NondeterministicBut there can be λ without <

Every < is preceded by λ. By default, ‘<‘ ∉ Σ

Page 16: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

16Kaplan & Kay 5 -

Left Context — 2

But there can be λ without <LC(λ)=P-iff-S(Σ* λ, < Σ*)

LC(λ)=(Σ* λ <)* Σ*

λ = a b

Page 17: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

17Kaplan & Kay 5 -

Left Context — 3

What about λ -prefixes in λ?

LC(a(b)) contains a <

a < b

a b <

but not a < b <

LC(λ)=P-iff-S((Σ* λ) <, < Σ*<)

LC(λ)=P-iff-S(Σ* λ, < Σ*)

Page 18: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

18Kaplan & Kay 5 -

Left Context — 4

What if ε ∈ λ?

Consider {ε} = λ. Every substring must be followedby <, including substrings that end in <. Thelanguage therefore contains no strings of finitelength.

LC(λ)=P-iff-S((Σ* λ) <, < Σ*<)

Page 19: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

19Kaplan & Kay 5 -

Left Context—3

Page 20: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

20Kaplan & Kay 5 -

Left Context—3

Page 21: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

21Kaplan & Kay 5 -

Left Context—3

Page 22: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

22Kaplan & Kay 5 -

Left Context Examples

λ = abab

xabxabab<xabab<ab<x

λ = ε

<a<b<c<d<e<f<g<

Page 23: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

23Kaplan & Kay 5 -

Left and Right Context

LC (λ, l, r)=P-iff-S((Σ* λ) l - (Σ* l l), < Σ*l)r

LeftContext(λ) = LC(λ, <, >)

RightContext(ρ) = Reverse(LC (Reverse(ρ) , >, <))

Page 24: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

24Kaplan & Kay 5 -

The Empty Left Context

LeftContext(ε)

Page 25: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

25Kaplan & Kay 5 -

The Empty Right Context

RightContext(ε)

Page 26: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

26Kaplan & Kay 5 -

One-character Left Context

LeftContext(a)

Page 27: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

27Kaplan & Kay 5 -

One Character Right Context

RightContext(a)

Page 28: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

28Kaplan & Kay 5 -

α → β / λ ρ Optional

Left to Right

Intro({<, >}) οId(RightContext(ρ)) ο

Replace(α, β) ο

Id(LeftContext(λ)) ο

Intro-1({<, >})

Right to Left

Intro({<, >}) οId(LeftContext(λ)) ο

Replace(α, β) ο

Id(RightContext(ρ)) ο

Intro-1({<, >})

Page 29: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

29Kaplan & Kay 5 -

Optional Simultaneous Application

Intro({<, >}) οId(RightContext(ρ) ∩ LeftContext(λ)) οReplace(α, β) οIntro-1({<, >})

Page 30: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

30Kaplan & Kay 5 -

Obligatory rules—Brackets

<a>a application

<i >i ignored

<c>c center

Whenever a rule is properly applied, the input side ofthe replacement relation will contain a substring ofthe form

Notation:

< = {<a, <i, <c}

> = {>a, >i, >c}

<aα<c>c>a

Page 31: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

31Kaplan & Kay 5 -

Obligatory Rules

Obligatory(φ, l, r) = Σ*m,0 l φ0m r Σ*m,0

PrologId(Obligatory(φ, <i, >))Id(RightContext(ρ,<,>))Replace (φ , ψ)

Id(LeftContext(λ,<,>))Prolog-1

PrologId(Obligatory(φ, <, >i))Id(LeftContext(λ,<,>))Replace(φ , ψ)

Id(RightContext(ρ,<,>))Prolog-1

Left to Right Right to Left

Page 32: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

32Kaplan & Kay 5 -

Other Topics

• Boundary Contexts

• Features

• 2-level Rules

Page 33: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

33Kaplan & Kay 5 -

Composition

i n t r a c t a b l e i m p r a c t i c a l

i N t r a c t a b l e i N p r a c t i c a l

i N t r a c t a b l e i m p r a c t i c a l0 0 2 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Page 34: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

34Kaplan & Kay 5 -

Lexical and Surface Forms

intractable → intractable

input → input

iNpractical → impractical

ArchiphonemesArchiphonemes

1. N → m / __ [+labial]2. N → n1. N → m / __ [+labial]2. N → n

Page 35: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

35Kaplan & Kay 5 -

An Optional Rule

N → n (Optional)

Start state: 0 Usually leftmost in the diagram

Final states have double circles

Start state: 0 Usually leftmost in the diagram

Final states have double circles

Page 36: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

36Kaplan & Kay 5 -

An Obligatory Rule

N → n (Obligatory)

other = all matched pairs ofsymbols not otherwise mentionedon any transition.

other = all matched pairs ofsymbols not otherwise mentionedon any transition.

Page 37: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

37Kaplan & Kay 5 -

Context

N → m / __ [+labial] (Obligatory)

No exit from thisstate except overa labial.

Page 38: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

38Kaplan & Kay 5 -

Composition

Rules 1 and 2Rules 1 and 2

2

1

Page 39: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

39Kaplan & Kay 5 -

Composition

input m-machine outputinput n-machine output

N labial follows m mN nonlabial follows N n

Page 40: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

40Kaplan & Kay 5 -

Generation — “intractable”

0 0

i

i

N

m

N

n

2

t

t

0

r

r

0

a

a

1

Page 41: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

41Kaplan & Kay 5 -

Generation — “impractical”

0 0

i

i

N

m

N

n

2

1

p

p

0

r

r

0

a

a

Page 42: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

42Kaplan & Kay 5 -

Recognition — “intractable”

0 0

i

i

n

n

N

n

2

t

t

0

r

r

0

a

a

0

t

t

0

r

r

0

a

a

Page 43: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

43Kaplan & Kay 5 -

Generation — “input”

0 0

i

i

N

m

N

n

2

1

p

p

0

u

u

0

t

t

0

Page 44: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

44Kaplan & Kay 5 -

A Word Transducer

Base Forms

Morphology

Spelling Rules

Text Forms

Finite-StateTransducers

Finite-stateMachine

Finite-state machine

Page 45: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

45Kaplan & Kay 5 -

Context Reuse

a → ε / b _

b a a a a a a

b φ0 = { φ if ε ∉ φ

[φ - ε] ∪ 0 otherwise

We need a separate left-context marker for each applicationof the rule. But they all have to be in the same place.Solution: Temporarily replace a with 0, and delete this later.

We need a separate left-context marker for each applicationof the rule. But they all have to be in the same place.Solution: Temporarily replace a with 0, and delete this later.

Page 46: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

46Kaplan & Kay 5 -

Epenthesis and Deletion

LC (λ, l, r,a)=P-iff-S((Σ* λ)l,a - (Σ*l l), l Σ*l)r

LeftContext(λ) = LC(λ , <, {>i, >c}, >a)

RightContext(ρ) = Reverse(LC(Reverse(ρ), >, {<i, <c}, <a)

Page 47: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

47Kaplan & Kay 5 -

Other Topics

• Boundary Contexts

• Batch Rules

• Features

Page 48: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

48Kaplan & Kay 5 -

Theorem

• Every rewriting grammar denotes a regularrelation.

• Every regular relation is denoted by somerewriting grammar.

Page 49: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

49Kaplan & Kay 5 -

Two-level Rule Systems

Page 50: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

50Kaplan & Kay 5 -

Parallel Combination

Lexical String

Surface String

T1 T2 Tn

Page 51: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

51Kaplan & Kay 5 -

Parallel CombinationLexical String

Surface String

T1 T2 Tn

Intro(0)

Intro-1(0)

Page 52: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

52Kaplan & Kay 5 -

Mathematically ...

Z = Intro(0)

Z o [IiTi] o Z-1 (Regular)

≠ Ii [Z o Ti o Z-1] (May not be regular)

Page 53: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

53Kaplan & Kay 5 -

Spiess p y + s #

s p y 0 s 0

s p y + s #

s p i 0 s 0

s p y + 0 s #

s p y 0 e s 0

s p y + 0 s #

s p i + e s 0

0:e <=> (Sib: or y:) +: s:s #

y:y <=> #: or +: i: or Π-{+:. #:}

Π= a:a ... z:z, 0:e, y:i, +:0, #:0Sib = {s, x, z}

Page 54: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

54Kaplan & Kay 5 -

Two-level Rules

τ ⇒ λ ρ Context restriction

If a τ pair-string appears, λ is before and ρ is after.

τ ⇐ λ ρ Surface CoercionIf the first component of a pair-string appearingbetween λ and ρ is in Domain(τ) , that pair-string

must be in τ.

τ ⇔ λ ρ Bicondition τ ⇒ λ ρ and τ ⇐ λ ρ

τ /⇐ λ ρ Surface ProhibitionIf the first component of a pair-string appearingbetween λ and ρ is in Domain(τ) , that pair-string

must NOT be in τ.

τ, λ, ρ in Π*

Page 55: Finite-State Methods in Natural-Language Processing ... · Kaplan & Kay 5 -45 Context Reuse a → ε / b _ b a a a a a a b φ0 = { φ if ε ∉ φ [φ - ε] ∪ 0 otherwiseWe need

55Kaplan & Kay 5 -

Observations

• τ, λ and ρ in Π* are same-length relations

• Therefore, closed under intersection andcomplementation

• Therefore, we can defineIf-P-then-S(R1, R2) = Π*- R1 (Π*- R2)

If-S-then-P(R1, R2) = Π*- (Π*- R1) R2