- NLP in Prolog: Given the grammar below:
S -> NP VP
NP -> pronoun | art noun | NP PP
VP -> verb NP | VP PP
PP -> prep NP
Give two parse trees for ``I saw the man with a telescope.''
- Construct an RTN that recgonizes the sentences generated by this grammar.
- Write prolog code for a parser based on this grammar that will generate
a parse tree as it parses. Assume the lexical productions, i.e.,
``noun $\rightarrow$ man'' etc. are already handled.
S -> NP VP
NP -> pronoun | art noun | NP PP
VP -> verb NP | VP PP
PP -> prep NP
- Assuming the grammar below:
S -> NP VP | NP aux VP
NP -> art noun | art noun noun
VP -> verb NP
art -> the
noun -> water | can
verb -> water | hold
aux -> can
Give the chart for the parse of the sentence ``The water can can hold water.''
after the second ``can'' has been processed.
- Features:
- What does the feature SUBCAT \_np\_np mean for a verb?
- Give a SUBCAT feature for the verb receive.
- What does it mean for VAR to be a ``head'' feature for S?
- Semantics:
- Simplify:((($\lambda$ x (x*y +5*x + 3)2)
- Simplify:(($\lambda$ x (x A))($\lambda$ y (Q y)))
- Represent: ``likes Mary'' as in ``John likes Mary''
using a lambda expression.
- Thematic Roles: What are the thematic roles in the sentence
``John gave a valentine to Mary at the party'' ?
- Using the rule
(VP VAR ?v SEM ($\lambda$ a3 (?semv ?v a3)))
$\rightarrow$ \hfill
(V SUBCAT \_np VAR ?v SEM ?semv)
(NP SEM ?semnp)
Show the SEM feature generated for VP assuming:
(V SUBCAT \_np VAR e3 SEM KISS1 VFORM PAST)
(NP SEM (NAME m1 ``Mary''))