Natural Language Processing

  1. Here is a grammar for a subset of Englsh:
    s --> np vp
    np --> det n
    vp --> v np
    vp --> v
    det --> the
    det --> a
    n --> man
    n --> woman
    v --> shoots
    
    1. Define, using examples, terminals and non-terminals.
    2. Write down a parse tree that uses the above grammar for the setence "the man shoots".
  2. Write down the following DCG as its equivalent Prolog program.
    s --> np, vp.
    
  3. Write a PROLOG DCG grammaer for the langauge "a2nbn".
  4. In English, "she" and "he" are subject pronouns and cannot be used in object position; "her" and "him" are object pronouns and cannot be used in subject position.
    1. The above grammar violates these rules. Give an example of that violation,.
    2. Write a new grammar that passes around information of object and subject appropriately. Hint: that grammar will contain:
      pro(subject) --> [he].
      pro(subject) --> [she].
      pro(object) --> [him].
      pro(object) --> [her].
      
  5. Modify the grammar from the previous question so that it can return a parse tree "s(np(det(the),n(woman)), vp(v(shoots),np(det(a),n(man)))))" for the sentence "the woman shoots a man"