;;; This is the code I added to my English grammar for the purposes ;;; of demoing the analysis of long distance dependencies (and ;;; in particular, wh questions). ;;; It is far from complete: Only complement extraction is handled, ;;; and the only wh word is "what". In general, this was done quickly, ;;; and is not intended as a well-worked out example to use as a model. ;;; ERB 2004-05-24 ;;; In english.tdl param-message := message & [ PARAMS list ]. wh_q_rel := quantifier_rel. wh-noun-lex := norm-hook-lex-item & zero-arg-que & [ SYNSEM [ LOCAL [ CAT [ HEAD noun, VAL [ SPR < >, COMPS < >, SUBJ < >, SPEC < > ] ], CONT [ RELS , HCONS ] ], NON-LOCAL.QUE ]]. non-subj-wh-question := basic-head-filler-phrase & head-final & interrogative-clause & [ SYNSEM.LOCAL [ CAT.VAL.SUBJ #subj, CONT.MSG #msg ], HEAD-DTR.SYNSEM.LOCAL [ CAT.VAL.SUBJ #subj, CONT.HOOK.LTOP #larg ], NON-HEAD-DTR.SYNSEM.NON-LOCAL.QUE , C-CONT [ RELS , MARG #marg ], message & [ PRED proposition_m_rel, LBL #marg, MARG #harg ] !>, HCONS ] ]. matrix-non-subj-wh := non-subj-wh-question & [ SYNSEM.LOCAL.CAT [ MC +, HEAD.INV + ]]. embedded-non-subj-wh := non-subj-wh-question & [ SYNSEM.LOCAL.CAT [ MC -, HEAD.INV - ]]. ;;; In rules.tdl matrix-ns-wh := matrix-non-subj-wh. embedded-ns-wh :=embedded-non-subj-wh. extr-comp := basic-extracted-comp-phrase. ;;; In lexicon.tdl what := wh-noun-lex & [ STEM < "what" > ]. ;;; I had to fix these types: ; determiner-lex no inherits from norm-zero-arg, not basic-zero-arg determiner-lex := basic-determiner-lex & norm-zero-arg & [ SYNSEM.LOCAL.CAT [ HEAD det, VAL [ SPR < >, COMPS < >, SUBJ < > ]]]. ; covert-det-phrase zeros out the non-local features. This might ; not scale covert-det-phrase := head-only & [ SYNSEM [ LOCAL.CAT.VAL [ SPR < >, SUBJ < >, COMPS < >, SPEC < > ], NON-LOCAL #nonloc & [ SLASH 0-dlist, REL 0-dlist, QUE 0-dlist ]], HEAD-DTR.SYNSEM [ LOCAL [ CAT.VAL [ SPR < [ OPT +, LOCAL.CAT.HEAD det ] >, SUBJ < >, COMPS < > ], CONT.HOOK [ INDEX #index, LTOP #larg ] ], NON-LOCAL #nonloc ], C-CONT [ RELS < ! quant-relation & [ LBL #ltop, ARG0 #index, RSTR #harg ] ! >, HCONS < ! qeq & [ HARG #harg, LARG #larg ] ! >, HOOK [ INDEX #index, LTOP #ltop ]]]. ; do-support-lex now inherits from basic-two-arg do-support-lex := no-hcons-lex-item & basic-two-arg & [ SYNSEM.LOCAL [ CAT [ HEAD verb & [ AUX +, INV - ], VAL [ SUBJ < #subj & [ LOCAL [ CAT [ HEAD noun & [ CASE nom ], VAL.SPR < >], CONT.HOOK.INDEX #ind ]]>, SPR < >, COMPS < #comps & [ LOCAL [ CAT [ HEAD verb & [ FORM base, AUX - ], VAL [ SUBJ < unexpressed-reg >, COMPS < >]], CONT.HOOK #hook & [ XARG #ind ]]] >, SPEC < > ]], CONT [ HOOK #hook, RELS , MSG no-msg ], ARG-S < #subj, #comps > ]].