The man bites the dog man bites the dog bites the dog the dog dog Parse Tree NP A N the man bites...

Preview:

Citation preview

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

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:

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"

Recommended