20 likes | 391 Views
Example Grammar. Parameter start symbol is S Rule {Satz} S -> NP VP. Rule {NP-Name} NP -> Name. Rule {NP} NP -> Det N. Rule {NP with mod} NP -> Det N PP. Rule {VP intransitiv} VP -> Vi. Rule {VP transitiv} VP -> Vt NP. Rule {VP intransitiv mit PP} VP -> Vi PP.
E N D
ExampleGrammar Parameter start symbol is S Rule {Satz} S -> NP VP. Rule {NP-Name} NP -> Name. Rule {NP} NP -> Det N. Rule {NP with mod} NP -> Det N PP. Rule {VP intransitiv} VP -> Vi. Rule {VP transitiv} VP -> Vt NP. Rule {VP intransitiv mit PP} VP -> Vi PP. Rule {VP transitiv mit PP} VP -> Vt NP PP. Rule {VP ditransitiv} VP -> Vt2 NP NP. Rule {VP mit PP-Objekt} VP -> Vpo PP. Rule {einfache PP} PP -> P NP. \w Mary \c Name \w John \c Name \w Susan \c Name \w Tom \c Name \w boy \c N \w girl \c N \w student \c N \w book \c N \w table \c N \w present \c N \w professor \c N \w village \c N \w park \c N \w laughed \c Vi \w jumped \c Vi \w cried \c Vi \w ran \c Vi \w saw \c Vt \w admired \c Vt \w slapped \c Vt \w avoided \c Vt \w put \c Vtp \w gave \c Vt2 \w lived \c Vp \w the \c Det \w a \c Det \w in \c P \w on \c P grammar lexicon f03b.grm + f02.lex
Exercises For each sentence, answer the questions: • how many parses does the grammar provide? • what are their structures? Then consider whether this is reasonable; in particular: • are there any structures which are not meaningful? • are there any structures that would have been expected but which are not produced? • the girl saw the boy • the girl saw the boy in the village • the girl in the park saw the boy in the village • the girl in the park gave the boy in the village a present • the girl in the park gave the boy a present in the park • Susan in the park gave the boy a present in the park • the boy in the park gave Susan a present in the park