DEMO ENGLISH CONFIG (1.0) ROOTCAT ROOT. LEXENTRIES (DEMO ENGLISH). RULES (DEMO ENGLISH). TEMPLATES (DEMO ENGLISH). FEATURES (DEMO ENGLISH). GOVERNABLERELATIONS SUBJ OBJ COMP OBL OBJ2 XCOMP. SEMANTICFUNCTIONS ADJUNCT MOD. NONDISTRIBUTIVES NUM PERS CONJ-FORM COORD-LEVEL. OPTIMALITYORDER. MORPHOLOGY (DEFAULT ENGLISH). ---- DEFAULT ENGLISH MORPHOLOGY (1.0) TOKENIZE: P!../default-parse-tokenizer.fsmfile G!../default-gen-tokenizer.fst ---- DEMO ENGLISH FEATURES (1.0) ADJUNCT-TYPE: -> $ { S VP NP AP }. ASPECT: -> $ { prog perf simple }. CASE: -> $ { nom acc }. COMP-FORM: -> $ { that }. CONJ-FORM: -> $ { and or }. COORD-LEVEL. INF: -> $ { + }. NTYPE: -> $ { common pron null}. NUM: -> $ { sg pl }. PCASE. "don't list since have so many" PERS: -> $ { 1 2 3 }. SPEC: -> $ { def indef null }. TENSE: -> $ { pres past }. TNS-ASP: -> << [ TENSE ASPECT ]. PASSIVE: -> $ { + }. VFORM: -> $ { prog pass perf }. o::. "have to declare projections" ---- DEMO ENGLISH RULES (1.0) ROOT --> S (@SENT-PUNCT) "@ hides the PUNCT label in the tree". S --> (ADV: @(ADJUNCT S)) NP: @UP-SUBJ @(DOWN-CASE nom); { VP |VPaux}. SENT-PUNCT --> { PERIOD |EXCL}. VP --> V { (NP: @UP-OBJ @(DOWN-CASE acc)) |NP: @UP-OBJ @(DOWN-CASE acc); NP: @UP-OBJ2 @(DOWN-CASE acc)} { ADV: @(ADJUNCT VP) |PP: { @(ADJUNCT VP) |@UP-OBL}}* ( SBAR: @UP-COMP). SBAR --> (COMP) S. VPaux --> AUX VP. NP --> { (D) AP*: @(ADJUNCT NP); Nmod*: @MOD; "noun noun compounds" N PP*: @(ADJUNCT NP) |PRON}. Nmod --> "noun-noun modifiers with optional adjective" (AP: @(ADJUNCT AP) @(OT-MARK RemoveAinNmod)) N: (^ SPEC)=null. PP --> P (NP: @UP-OBJ @(DOWN-CASE acc)). AP --> (AMOD: @(ADJUNCT AP)) A. SC-COORD(_CAT) = "basic same category coordination for things other than nominals" _CAT: @IN-SET; "IN-SET gives ! $ ^" CONJ: @(COORD-LEVEL _CAT); _CAT: @IN-SET. NP-COORD(_CAT) = "basic coordination for nominals" _CAT: @IN-SET @NP-CONJ; "IN-SET gives ! $ ^" CONJ: @(COORD-LEVEL _CAT); _CAT: @IN-SET @NP-CONJ. METARULEMACRO(_CAT _BASECAT _RHS) = "operates on all rules" "you can ignore _BASECAT in this grammar" { _RHS |e: _CAT ~$ { N NP PRON }; @(SC-COORD _CAT) |e: _CAT $ { N NP PRON }; @(NP-COORD _CAT) }. V --> TRUE. N --> TRUE. A --> TRUE. PRON --> TRUE. ---- DEMO ENGLISH TEMPLATES (1.0) OT-MARK(_M) = _M $ o::*. PERS(_V) = (^ PERS)=_V. CONJ(_C) = "conjunction" (^ CONJ-FORM)=_C. COORD-LEVEL(_C) = (^ COORD-LEVEL)=_C. NP-CONJ = { "if any conjunct is first person," "the whole NP is first person" (! PERS)=1 (^ PERS)=1 |"if any conjunct is second person," "the whole NP is second person" "unless there was a first person conjunct" (! PERS)= 2 { (^ PERS)=c 1 |(^ PERS)=2 } | "third person if both conjuncts are" (! PERS)= 3 { (^ PERS)=c 1 |(^ PERS)=c 2 |(^PERS)=3 }}. IN-SET = ! $ ^. ADJECTIVE(_P) = @(PRED _P). COUNT-NOUN-SG(_P) = @(NOUN-SG _P) @COUNT-NOUN. COUNT-NOUN-PL(_P) = @(NOUN-PL _P) @COUNT-NOUN. COUNT-NOUN = "spec requirements for count nouns" { (^ NUM)=pl |(^ NUM)~=pl (^ SPEC)}. NOUN-SG(_P) = "template for singular nouns" @(PRED _P) @(NUM sg) @(PERS 3) (^ NTYPE) =common. NOUN-PL(_P) = "template for plural nouns" @(PRED _P) @(NUM pl) @(PERS 3) @(NTYPE ^ common). PRED(_P) = "basic PRED with no arguments" (^ PRED)='_P'. TNS-ASP(_T _A) = @(TENSE _T) @(ASPECT _A). PREPOSITION(_V) = (^ PRED)='_V<(^OBJ)>' (^ OBJ PCASE)=_V. NTYPE(_PATH _V) = (_PATH NTYPE)=_V. NULL-PRON(_P) = (_P PRED)='pro' (_P NTYPE)=null. SPEC(_V) = (^ SPEC)=_V. V3SG = { (^ SUBJ NUM)= sg (^ SUBJ PERS)= 3 | { (^ SUBJ NUM) ~= sg | (^ SUBJ PERS) ~= 3 } @(OT-MARK BadVAgr) }. VPROG = @(VFORM prog) (^ TNS-ASP ASPECT)=c prog. VPERF = @(VFORM perf) (^ TNS-ASP ASPECT)=c perf. V-NOT-3SG = { (^ SUBJ NUM) =sg (^ SUBJ PERS)~=3 |(^ SUBJ NUM)= pl | (^ SUBJ NUM) =c sg (^ SUBJ PERS) =c 3 @(OT-MARK BadVAgr) }. V-INTRANS(_P) = (^PRED)='_P<(^ SUBJ)>' @NOPASSIVE. V-TRANS(_P) = @(PASSIVE (^PRED)='_P<(^ SUBJ)(^ OBJ)>'). V-INTRANS-TRANS(_P) = { @(V-INTRANS _P) |@(V-TRANS _P)}. V-DITRANS(_P) = (^PRED)='_P<(^ SUBJ)(^ OBJ)(^ OBJ2)>' @NOPASSIVE "not strictly speaking true". V-OBL(_P _PREP) = (^PRED)='_P<(^ SUBJ)(^ OBL)>' (^ OBL OBJ PCASE)=c _PREP @NOPASSIVE. V-COMP(_P) = "say type verbs: I said that she laughs" (^ PRED)='_P<(^ SUBJ)(^ COMP)>' @NOPASSIVE. V-OBJ-COMP(_PRED) = "tell type verbs: I told them that he slept" @(PASSIVE (^PRED)='_PRED<(^ SUBJ)(^ OBJ)(^ COMP)>') (^ COMP TENSE). PASSIVE(_SCHEMA) = "passive sublexical rule" { _SCHEMA @NOPASSIVE |_SCHEMA (^ VFORM) =c pass (^ PASSIVE)= + (^ OBJ)-->(^ SUBJ) { (^ SUBJ)-->NULL |(^ SUBJ)-->(^ OBL) (^ OBL OBJ PCASE)=c by @(OT-MARK ByObl) }}. ASPECT(_V) = (^ TNS-ASP ASPECT)=_V. TENSE(_V) = (^ TNS-ASP TENSE)=_V. NOPASSIVE = (^ PASSIVE)~=+. NUM(_V) = "assigns value to number feature" (^ NUM)=_V. UP-OBJ = "annotation to assign object function" @(UP-GF OBJ). UP-SUBJ = @(UP-GF SUBJ). UP-OBL = @(UP-GF OBL). UP-OBJ2 = @(UP-GF OBJ2). UP-COMP = @(UP-GF COMP). UP-XCOMP = @(UP-GF XCOMP). ADJUNCT(_T) = ! $ (^ ADJUNCT) (! ADJUNCT-TYPE)= _T. MOD = ! $ (^ MOD). DOWN-CASE(_V) = (! CASE)=_V. UP-GF(_GF) = "generic annotation to assign a grammatical function" (^ _GF)=!. PRON(_P _PERS _NUM _CASE) = @(PRED _P) @(PERS _PERS) @(NUM _NUM) (^ CASE)=_CASE @(NTYPE ^ pron). COMP-FORM(_F) = (^ COMP-FORM) = _F. PASSIVE-AUX(_T) = @(TENSE _T) (^ PASSIVE)=c + (^ VFORM)=c pass. PROG-AUX(_T) = @(TENSE _T) @(ASPECT prog) (^ VFORM)=c prog. VFORM(_F) = (^ VFORM)=_F. ---- DEMO ENGLISH LEXICON (1.0) and CONJ * @(CONJ and) (^ NUM)=pl. or CONJ * @(CONJ or). is AUX * @V3SG { @(PROG-AUX pres) |@(PASSIVE-AUX pres)}. was AUX * { @V3SG | (^ SUBJ PERS)= 1 (^ SUBJ NUM)= sg } { @(PROG-AUX past) |@(PASSIVE-AUX past)}. are AUX * { (^ SUBJ PERS)=2 | (^ SUBJ PERS)=3 (^ SUBJ NUM)=pl | (^ SUBJ PERS)=1 (^ SUBJ NUM)=pl} { @(PROG-AUX past) |@(PASSIVE-AUX pres)}. were AUX * { (^ SUBJ PERS)=2 | (^ SUBJ PERS)=3 (^ SUBJ NUM)=pl | (^ SUBJ PERS)=1 (^ SUBJ NUM)=pl} { @(PROG-AUX past) |@(PASSIVE-AUX past)}. in P * @(PREPOSITION in). about P * @(PREPOSITION about). with P * @(PREPOSITION with). by P * @(PREPOSITION by). the D * @(SPEC def). a D * @(SPEC indef) @(NUM sg). an D * @(SPEC indef) @(NUM sg). girl N * @(COUNT-NOUN-SG girl). girls N * @(COUNT-NOUN-PL girl). box N * @(COUNT-NOUN-SG box). boxes N * @(COUNT-NOUN-PL box). garden N * @(COUNT-NOUN-SG garden). gardens N * @(COUNT-NOUN-PL garden). tractor N * @(COUNT-NOUN-SG tractor). tractors N * @(COUNT-NOUN-PL tractor). trailer N * @(COUNT-NOUN-SG trailer). trailers N * @(COUNT-NOUN-PL trailer). monkey N * @(COUNT-NOUN-SG monkey). monkeys N * @(COUNT-NOUN-PL monkey). banana N * @(COUNT-NOUN-SG banana). bananas N * @(COUNT-NOUN-PL banana). telescope N * @(COUNT-NOUN-SG telescope). telescopes N * @(COUNT-NOUN-PL telescope). park N * @(COUNT-NOUN-SG park); V * @(V-INTRANS park) @(TENSE pres) @V-NOT-3SG. parks N * @(COUNT-NOUN-PL park); V * @(V-INTRANS park) @(TENSE pres) @V3SG. sheep N * @(PRED sheep) @COUNT-NOUN. devours V * @(V-TRANS devour) @V3SG @(TENSE pres). devour V * @(V-TRANS devour) @V-NOT-3SG @(TENSE pres). devoured V * @(V-TRANS devour) { @(TENSE past) |@(VFORM pass)}. devouring V * @(V-TRANS devour) @VPROG. pushed V * @(V-INTRANS-TRANS push) { @(TENSE past) |@(VFORM pass)}. sees V * @(V-TRANS see) @V3SG @(TENSE pres). saw V * @(V-TRANS see) @(TENSE past). seen V * @(V-TRANS see) @(VFORM pass). laughed V * @(V-INTRANS laugh) @(TENSE past). sleeping V * @(V-INTRANS sleep) @VPROG. sleeps V * @(V-INTRANS sleep) @V3SG @(TENSE pres). sleep V * @(V-INTRANS sleep) @V-NOT-3SG @(TENSE pres). slept V * @(V-INTRANS sleep) @(TENSE past). give V * @(V-DITRANS give) @V-NOT-3SG @(TENSE pres). gives V * @(V-DITRANS give) @V3SG @(TENSE pres). gave V * @(V-DITRANS give) @(TENSE past). given V * @(V-DITRANS give) @(VFORM pass). giving V * @(V-DITRANS give) @VPROG. thought V * { @(V-OBL think about) |@(V-INTRANS think)} @(TENSE past). yesterday ADV * @(PRED yesterday). today ADV * @(PRED today). orange N * @(COUNT-NOUN-SG orange); A * @(ADJECTIVE orange). purple N * @(NOUN-SG purple); A * @(ADJECTIVE purple). good A * @(ADJECTIVE good); N * @(NOUN-SG good). happy A * @(ADJECTIVE happy). ate V * @(V-INTRANS-TRANS eat) @(TENSE past). eats V * @(V-INTRANS-TRANS eat) @(TENSE pres) @V3SG. eat V * @(V-INTRANS-TRANS eat) @(TENSE pres) @V-NOT-3SG. eating V * @(V-INTRANS-TRANS eat) @VPROG. eaten V * @(V-INTRANS-TRANS eat) @(VFORM pass). know V * @(V-COMP know) @(TENSE pres) @V-NOT-3SG. knows V * @(V-COMP know) @(TENSE pres) @V3SG. say V * @(V-COMP say) @(TENSE pres) @V-NOT-3SG. says V * @(V-COMP say) @(TENSE pres) @V3SG. tell V * @(V-OBJ-COMP tell) @(TENSE pres) @V-NOT-3SG. tells V * @(V-OBJ-COMP tell) @(TENSE pres) @V3SG. very AMOD * @(PRED very). . PERIOD *. ! EXCL *. he PRON * @(PRON he 3 sg nom). him PRON * @(PRON he 3 sg acc). she PRON * @(PRON she 3 sg nom). her PRON * @(PRON she 3 sg acc). I PRON * @(PRON I 1 sg nom). me PRON * @(PRON I 1 sg acc). they PRON * @(PRON they 3 pl nom). them PRON * @(PRON they 3 pl acc). you PRON * { @(PRON you 2 pl acc) "just treat as plural for now" |@(PRON you 2 pl nom)}. that COMP * @(COMP-FORM that). ----