3
the man bites the dog the man bites the dog the man bites the dog man bites the dog bites the dog bites the dog the dog the dog dog Parse Tree N A the man bites the dog V N NP S VP A 1. Sentence noun-phrase verb-phrase 2. Noun-phrase noun 3. Noun-phrase article noun 4. Verb-phrase verb 5. Verb-phrase verb noun-phrase 6. Article a 7. Article the 8. Noun man 9. Noun dog 10. Verb likes 11. Verb bites

The man bites the dog man bites the dog bites the dog the dog dog Parse Tree NP A N the man bites the dog V N NP S VP A 1. Sentence noun-phrase verb-phrase

Embed Size (px)

Citation preview

Page 1: The man bites the dog man bites the dog bites the dog the dog dog Parse Tree NP A N the man bites the dog V N NP S VP A 1. Sentence  noun-phrase verb-phrase

the man bites the dogthe man bites the dogthe man bites the dogman bites the dogbites the dogbites the dogthe dogthe dogdog

Parse Tree

NP

A N

theman

bites

thedog

V

N

NP

S

VP

A

1. Sentence noun-phrase verb-phrase2. Noun-phrase noun3. Noun-phrase article noun4. Verb-phrase verb5. Verb-phrase verb noun-phrase6. Article a7. Article the8. Noun man9. Noun dog10. Verb likes11. Verb bites

Page 2: The man bites the dog man bites the dog bites the dog the dog dog Parse Tree NP A N the man bites the dog V N NP S VP A 1. Sentence  noun-phrase verb-phrase

S NP VP NP <name> | <det> <noun> |PP

VP <verb> | <verb> NP NP | <verb> NP PP | VP NP PP <prep> NP

<name> “Ben" | “Ann"<noun> "morning" | “ice-cream"<verb> "gave" | "saw"<det> "the" <prep> "to" | "in"

S – SENTENCENP – NOUN PHRASEVP – VERB PHRASEDET – DETERMINERPP - PREPOSITION

S – SENTENCENP – NOUN PHRASEVP – VERB PHRASEDET – DETERMINERPP - PREPOSITION

Question: Consider the grammar defined by the following BNF:

Page 3: The man bites the dog man bites the dog bites the dog the dog dog Parse Tree NP A N the man bites the dog V N NP S VP A 1. Sentence  noun-phrase verb-phrase

Draw parse trees in this grammar for the following sentences. a) Ben gave Ann the ice-cream.

b)   Ann gave the ice-cream to Ben.

Answers:

S NP VP NP <name> | <det> <noun> |PP

VP <verb> | <verb> NP NP | <verb> NP PP | VP NP PP <prep> NP

<name> “Ben" | “Ann"<noun> "morning" | “ice-cream"<verb> "gave" | "saw"<det> "the" <prep> "to" | "in"