Natural Language Processing - Homework 2

Due to: April 30, 2000

DCG grammar

  1. Modify the grammar to allow for adjectives before nouns.
    Examples:
    The blue dog ate a sandwich
    A big happy dog came to visit
  2. Modify the grammar to allow for prepositional phrase modifiers on verb and noun phrases. A preposition pharse is a phrase that is structed from a preposition (like on, to, from, at, in, during) and a noun phrase (for the extent of this exercise).
    Examples:
    1. A preposition phrase that modifies a noun
      The dog in the street is barking.
    2. A preposition phrase that modifies a verb phrase
      The dog was barking in the street
  3. Make a distinction between restrictive and nonrestrictive relative clauses. In "The truck that has 4-wheel drive costs $5000" - the italicized relative clause is restrictive. It serves to identify the truck and thus would be part of the quantifier's restriction. The complete sentence might be interpreted as:
            (and (the ?x (and (truck ?x) (4-wheel-drive ?x)))
                 (costs ?x $5000))
    
    Contrast this with "The truck which has 4-wheel drive costs $5000". Here the relative clause is nonrestirctive and thus belongs outside the quantifier's restriction.
            (and (the ?x (track ?x)) 
                 (4-wheel-drive ?x) (costs ?x $5000))
    
    Note: these output examples are aimed to show you the difference in semantics in two instances, and are not the exact output of the grammar (it lacks some of the features, so don't let it confuse you!)

    Also note: the distinction between the two cases in this homework will be following the use of which (non-restrictive) and that (restrictive).

--------------------------------
that's all.

How to load the grammar

The source codes for norvig's unify grammar are located in this directory. You can use load-unify-grammar.l to load all files that are necessary for running it.
The syntax rules are found in file unifgram.dat. Use the last version of the grammar and change it according to the given questions.
Examples for running:
(?- (S ?sem (the girl kissed the boy) ()))
?SEM = (KISS (THE (YOUNG FEMALE HUMAN)) (THE (YOUNG MALE HUMAN))).
No.


For any question, contact me: yaeln@cs.bgu.ac.il
Back to course homepage

Last modified April 2, 2000