;;; -*- Mode: Lisp; Syntax: Common-Lisp; Base: 10 -*- ;;; GRAMMAR DATA FILE ; Name: CFG1 Type: CFG (add-rule-set 'CFG1 'CFG) (add-rule-list 'CFG1 '( (S ==> S PP) ;; a sentence(S) can be an S and a prepositional phrase(PP) (S ==> NP VP) ;; an S can be a noun-phrase(NP) and a verb-phrase(VP) (VP ==> VP PP) ;; a VP can be a VP and a PP (VP ==> V1 NP) ;; a VP can be a verb type 1 (one parameter,V1) and a NP (VP ==> V2 NP PP) ;;a VP can be a verb type 2 (two parameters,V2), a NP ;; and a PP (send the book to Baris) (VP ==> V2 NP NP) ;;a VP can be a V2 and two NPS : send Baris the book (VP ==> V0) ;; a VP can be a no parameter verb (type 0,V0), like Baris thought (VP ==> V1 A) ;; a VP can be a V1 and an adjective(A) (VP ==> VSBAR SBAR) ;; a VP can be a verb that takes sub-sentence (VSBAR) and ;; a subsentence(SBAR) (SBAR ==> COMP S) ;; an SBAR can be a complementizer(COMP) and an S (SBAR ==> S) ;; an SBAR can be just an S (eg: I thought it was not appropriate) (PP ==> P PP) ;; a PP can be a preposition(P) and a PP (PP ==> P NP) ;; a PP can be a preposition(P) and a NP (NP ==> NP PP) ;; a NP can be a NP and a PP (NP ==> DET N) ;; a NP can be a determinant(DET) and a noun (N) (NP ==> POS N) ;; a NP can be a posessive(POS) and a N (NP ==> NP*) ;; a NP can be a special noun (NP*) (ROOT ==> NP) ;; root can be a NP (ROOT ==> S) ;; root can be a S )) ; Name: DICT1 Type: DICTIONARY (add-rule-set 'DICT1 'DICTIONARY) (add-rule-list 'DICT1 '((POIROT NP*) (SOLVED V1) (THE DET) (CASE N) (DETECTIVES N) (LOST V1) (THEIR POS) (GUNS N) (THOUGHT V0) (THOUGHT VSBAR) (SENT V2) (SOLUTION N) (TO P) (POLICE N) (BELIEVED VSBAR) (THAT COMP) (WERE V1) (INCOMPETENT A) (TALK N) (TIMBUCTOU NP*) (ISTANBUL NP*) (SHOT N) (SHOT V) (WALK N) (THREW V) (TALKED V) (TALK V) (WALKED V) (WALK V) (GIRL N) (BOY N) (CAR N) (HOUSE N) (STORE N) (STREET N) (TREE N) (WOMAN N) (MAN N) (CAT N) (DOG N) (INTO P) (ABOVE P) (IN P) (UP P) (OF P) (FROM P) (AN DET) (A DET) (WORCESTER NP*) )) (remove-rule-set 'ct1) (create-cfg-table 'ct1 'cfg1 'root 1)