;; This defines the grammars and lexicons in
;; Chapter 4. It does not contain a morphological analyzer, however
;;  so you must break apart suffixes yourself. For instance, if you call
;;  (BU-parse '(Jack cries))
;;   the parser will complain about an unknown word "cries"
;; The right form should be
;;  (BU-parse '(Jack cry +s))

;;  Try (BU-parse '(a fish saw the man))
;;      (BU-parse '(the man want +s Jack the fish to cry)) 

(setq *lexicon4-4*
  '((a (art (agr 3s) (root A1)))
    (be (v (root BE1) (vform bare) (subcat (? s _adjp _np)) (irreg-pres +) (irreg-past +)))
    (cry (v (root CRY1) (vform bare) (subcat _none)))
    (dog (n (root DOG1) (agr 3s)))
    (fish (n (root FISH1) (agr (? a 3s 3p))))
    (happy (adj (subcat _vp-inf) (root HAPPY1)))
    (he (pro (root HE1) (AGR 3s)))
    (is (v (root BE1) (VFORM pres) (SUBCAT (? s _adjp _np)) (AGR 3s)))
    (Jack (name (agr 3s) (root JACK1)))
    (man (n (root MAN1) (agr 3s)))
    (men (n (root MAN1) (agr 3p)))
    (saw (n (root SAW1) (agr 3s)))
    (saw (v (root SAW2) (vform bare) (subcat _np)))
    (saw (v (root SEE1) (VFORM past) (subcat _np) (agr (? a))))
    (see (v (root SEE1) (VFORM bare) (subcat _np) (irreg-past +) (en-pastprt +)))
    (seed (n (root SEED1) (AGR 3s)))
    (the (art (root THE1) (agr (? a 3s 3p))))
    (to (to (agr -) (vform inf)))
    (want (v (root WANT1) (VFORM bare) (subcat (? s _np _vp-inf _np_vp-inf))))
    (was (v (root BE1) (VFORM past) (AGR (? a 1s 3s)) (SUBCAT (? s _adjp _np))))
    (were (v (root BE1) (VFORM past) (AGR (? a 2s 1p 2p 3p)) (SUBCAT (? s _adjp _np))))
    (+s (+S))
    (+ed (+ED))
    (+en (+EN))
    (+ing (+ING))))

(setq *grammar4-5* 
      '((headfeatures
         (v root subcat)
         (n root))
        ((v (vform pres) (agr 3s))
         -1> 
         (head (v (vform bare) (irreg-pres -))) (+s))
        ((v (vform pres) (agr (? a 1s 2s 1p 2p 3p)))
         -2> 
         (head (v (vform bare) (irreg-pres -))))
        ((v (vform past)  (agr (? a 1s 2s 3s 1p 2p 3p)))
         -3> 
         (head (v (vform bare) (irreg-past -))) (+ed))
        ((v (vform pastprt))
         -4> 
         (head (v (vform bare) (en-pastprt -))) (+ed))
        ((v (vform pastprt))
         -5> 
         (head (v (vform bare) (en-pastprt +))) (+en))
        ((v (vform ing))
         -6> 
         (head (v (vform bare))) (+ing))
         ((n (agr 3p))
          -7> 
          (head (n (agr 3s) (irreg-pl -))) (+s))))


(setq *grammar4-7*
      '((headfeatures
         (s agr)
         (vp vform agr)
         (np agr))
        ((s (inv -))
          -1> 
             (np  (agr ?a)) (head (vp (vform (? v past pres)) (agr ?a))))
         ((np)
           -2> 
               (art (agr ?a))  (head (n (agr ?a))))
        ((np)
           -3> 
             (head (pro)))
        ((vp)
           -4> 
              (head (v (subcat _none))))
        ((vp)
           -5> 
              (head (v (subcat _np))) (np))
        ((vp)
            -6> 
               (head (v (subcat _vp-inf))) (vp (vform inf)))
        ((vp)
           -7> 
              (head (v (subcat _np_vp-inf))) (np) (vp (vform inf)))
        ((vp)
           -8> 
               (head (v (subcat _adjp))) (adjp))
        ((vp (vform inf))
           -9>
              (head (to)) (vp (vform bare)))
        ((adjp)
           -10>
             (head (adj)))
        ((adjp)
           -11>
              (head (adj (subcat _inf))) (vp (vform inf)))))


