100 likes | 281 Views
FSG, RegEx, and CFG. Chapter 2 Of Sag’s Syntactic Theory. Regular Expressions. Attempts to capture the generalizations and observable patterns in a language e.g. words such as apple, book, color , and dog can appear in roughly same contexts (pg 23 ex 13)
E N D
FSG, RegEx, and CFG Chapter 2 Of Sag’s Syntactic Theory
Regular Expressions • Attempts to capture the generalizations and observable patterns in a language e.g. words such as apple, book, color, and dog can appear in roughly same contexts (pg 23 ex 13) • Makes use of grammatical categories and notations such as Kleene Star (*) to express or describe a string of well-formed sentences. • Other notations include: (), |, +… etc
Regular Expressions • “Jena likes sandwiches.” • Lexicon: noun {Jena, sandwiches}; verb {likes} • Notation: NOUN VERB NOUN • “Jena likes bagel sandwiches.” • noun {Jena, sandwiches}; verb {likes}; adj {bagel} • NOUN VERB ADJ* NOUN • “Jena buys bagel sandwiches.” • noun {Jena, sandwiches}; verb {likes,buys}; adj {bagel} • NOUN VERB ADJ* NOUN • “Jena eatsbreakfast bagel sandwiches.” • noun {Jena, sandwiches}; verb {likes,buys,eats}; adj {bagel, breakfast} • NOUN VERB ADJ* NOUN
Problems? • “Jena feels full.” • NOUN VERB (ADJ* NOUN) | ADJ • “She thinks she ate too much.” • NOUN VERB (ADJ* NOUN) | (ADJ) | … • “Her friends agree.” • “Jena swears to herself never to eat too much again.” • “Her wise friends don’t believe her.” • Fails to account for possible options in the “slots” • Fails to recognize certain strings form units • Fails to represent ambiguities such as “I saw the astronomer with a telescope.” (pg 28)
Context Free Grammar • Components • LEXICON: list of words, with the associated categories • Set of RULES that look like A -> • Like algebraic equations … • NT1 -> T1 NT2 • NT2 -> T2 • Recursive: • NT -> (T1) T2 NT
Context Free Grammar • Rules:S -> NP VPVP -> V (NP) (NP) VP -> VP PPPP -> P NP NP -> (D) NOMNOM -> NNOM -> NOM PPX -> X+ CONJ X(p31) (coordination rule)
Constituents • How the constituents are divided and where they are attached can account for ambiguity in ambiguous sentences. • Strings joined by coordinate conjunction are probably constituents • Strings that can appear in multiple environments are probably constituents
Constituency Tests • Fronting • They drink tea in the morning.In the morning, they drink tea. • Cleft • He saw a man in green suit.It wasa man in green suitthat he saw. • Substitution • I can’t function without a good cup of coffee.I can’t function without it.
Redundant Overgenerates The teacher handed the student a book *The teacher handed the student. *The teacher handed a book. *The teacher handed. Too recursive? S -> NP VP; VP -> VP PP X -> X+ CONJ X Arbitrary - no headedness Problems?
In FSG/RegEx and CFG • He is an overly generous, kind, sweet man. • They are stupid and ugly and nobody likes them. • The big brown dog with fleas watched the bird beside the hunter. • Take either the stairs to your left or elevator to your right.