Download presentation
Presentation is loading. Please wait.
Published byKelly Stevens Modified over 9 years ago
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 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
2
S NP VP NP | |PP VP | NP NP | NP PP | VP NP PP NP “Ben" | “Ann" "morning" | “ice-cream" "gave" | "saw" "the" "to" | "in" S – SENTENCE NP – NOUN PHRASE VP – VERB PHRASE DET – DETERMINER PP - PREPOSITION S – SENTENCE NP – NOUN PHRASE VP – VERB PHRASE DET – DETERMINER PP - PREPOSITION Question: Consider the grammar defined by the following BNF:
3
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 | |PP VP | NP NP | NP PP | VP NP PP NP “Ben" | “Ann" "morning" | “ice-cream" "gave" | "saw" "the" "to" | "in"
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.