DEMO ENGLISH CONFIG (1.0)
ROOTCAT ROOT. "changed to ROOT from S"
FILES common.templates.lfg .
LEXENTRIES (DEMO ENGLISH).
TEMPLATES (DEMO ENGLISH) (STANDARD COMMON). "added common ParGram templates"
RULES (DEMO ENGLISH).
MORPHOLOGY (DEMO ENGLISH).
GOVERNABLERELATIONS SUBJ OBJ OBJ2 COMP XCOMP OBL OBL-?+.
SEMANTICFUNCTIONS ADJUNCT TOPIC FOCUS POSS STANDARD.
NONDISTRIBUTIVES NUM PERS COORD-FORM.
EPSILON e.
OPTIMALITYORDER NOGOOD PPadj +PPattach +sg-imp.
GENOPTIMALITYORDER GenBadPunct NOGOOD +Punct. "added punctuation control"
----
DEMO ENGLISH MORPHOLOGY (1.0)
TOKENIZE:
P!basic-parse-tok.fst G!default-gen-tokenizer.fst
----
DEMO ENGLISH RULES (1.0)
ROOT --> "can have other things here as well, imperatives, etc."
S.
S --> NP: (^ SUBJ)=!
(! CASE)=nom;
VP: (^ TNS-ASP TENSE); "require that sentences have tense"
(PERIOD: @(OT-MARK Punct)). "prefer for generation"
VP --> (AUX) "auxiliary introduced for passive"
V: ^=!; "head of VP"
(NP: (^ OBJ)=! "direct object"
(! CASE)=acc)
(NP: (^ OBJ2) = !) "secondary object"
PP*: { ! $ (^ ADJUNCT) "PPs can be all types of adjuncts"
(! PTYPE) =c sem "only semantic PPs here"
@(OT-MARK PPadj) "disprefer adjunct PPs"
| (^ OBL) = ! "or a a general oblique"
};
(PP: (^ OBL-TO) = ! "special obl for ditransitives"
"example of a constraining equation: require a value with =c"
(! PFORM) =c to)
(PP: (^ OBL-AG) = ! "oblique agent of passive"
"example of a constraining equation: require a value with =c"
(! PFORM) =c by ).
NP --> "either a full NP or a PRON"
{ (D) "optional determiner"
AP*: ! $ (^ ADJUNCT); "introducing adjectives in sets"
N "head of NP"
PP*: ! $ (^ ADJUNCT) "PPs modifying NPs"
(! PTYPE) =c sem "have to be semantic"
@(OT-MARK PPattach) "prefer PPs attached to NPs"
| PRON}.
AP --> ADV*: ! $ (^ ADJUNCT);
A
(COMMA).
PP --> { P: ^ = ! "head of PP"
(! PTYPE) =c sem; "semantic type, Adjunct"
NP: (^ OBJ) = !
(! CASE) = acc
| P: ^ = ! "head of PP"
(! PTYPE) =c nosem; "non-semantic type, OBL"
NP
}.
----
DEMO ENGLISH TEMPLATES (1.0)
OT-MARK(_mark) = "assigns an OT mark, from common templates"
_mark $ o::*.
PASS(FRAME) = { FRAME "no passive, just give back subcat frame"
(^ PASSIVE) = - "no passive"
| FRAME "passive"
(^ PASSIVE) = + "mark as such"
(^ PARTICIPLE) =c past "make sure to have a past participle"
(^ OBJ)-->(^ SUBJ) "obj goes to subj"
{ (^ SUBJ)-->(^ OBL-AG) "either make subj obl-ag"
| (^ SUBJ)--> NULL "or delete"
}
}.
DAT-SHIFT(SCHEMATA) = { SCHEMATA
| SCHEMATA
(^ OBJ)-->(^ OBJ2)
(^ OBL-TO)-->(^ OBJ)}.
DITRANS(P) = @(PASS @(DAT-SHIFT (^ PRED)='P<(^ SUBJ) (^ OBJ) (^ OBL-TO)>')).
"transitives can passivize"
TRANS(P) = @(PASS (^ PRED)='P<(^ SUBJ) (^ OBJ)>').
INTRANS(P) = (^ PRED) = 'P<(^SUBJ)>'.
INTRANS-OBL(P) = (^ PRED) = 'P<(^SUBJ)(^OBL)>'.
OPT-TRANS(P) = { (^ PRED) = 'P<(^SUBJ)(^OBJ)>' "P is a variable"
| (^ PRED) = 'P<(^SUBJ)>' }. "this template takes one argument: P"
TENSE(T) = (^ TENSE) = T. "the more general case"
CASE(C) = (^ CASE) = C.
MOOD(M) = (^ MOOD) = M.
VPRES = @(TENSE pres)
@(MOOD indicative).
VPAST = @(TENSE past)
@(MOOD indicative).
PRED(P) = (^ PRED) = 'P'.
PASTP = (^ PARTICIPLE) = past.
BARE-AGR = { (^ SUBJ NUM) = pl "either it is plural"
| (^ SUBJ PERS) ~= 3 "or singular and not 3rd person"
(^ SUBJ NUM) = sg
@(OT-MARK sg-imp) "prefer a singular imperative"
}.
S-AGR = (^ SUBJ PERS) = 3 "for verbs in -s"
(^ SUBJ NUM) = sg.
COUNT-NOUN(P N) = @(PRED P)
(^ NUM) = N
(^ PERS) = 3
(^ NTYPE) = count.
PREP(P) = "template for most prepositions"
{ (^ PRED) = 'P<(^OBJ)>'
(^ PTYPE) = sem
| (^ PTYPE) = nosem
(^ PFORM) = P}.
"template for pronouns of all types"
PRON(P Z N T) = (^ PRED) = 'P'
(^ NUM) = N
(^ PERS) = Z
(^ PRON-TYPE) = T
(^ NTYPE) = pron.
DEF = (^ DEF).
----
DEMO ENGLISH LEXICON (1.0)
bed N * @(COUNT-NOUN bed sg).
bone N * @(COUNT-NOUN bone sg).
bones N * @(COUNT-NOUN bone pl).
homework N * @(COUNT-NOUN homework sg).
dog N * @(COUNT-NOUN dog sg).
dogs N * @(COUNT-NOUN dog pl).
gorilla N * @(COUNT-NOUN gorilla sg).
gorillas N * @(COUNT-NOUN gorilla pl).
telescope N * @(COUNT-NOUN telescope sg).
garden N * @(COUNT-NOUN garden sg).
tree N * @(COUNT-NOUN tree sg).
"all verbs here"
saw V * @(TRANS see) "optionally transitive verbs"
@VPAST.
ate V * @(OPT-TRANS eat) "optionally transitive verbs"
@VPAST.
eats V * @(OPT-TRANS eat)
@VPRES
@S-AGR.
drinks V * @(OPT-TRANS drink)
@VPRES
@S-AGR.
devour V * @(TRANS devour)
"don't do this, do Lexical Rules instead"
"{ (^ PRED) = 'devour<(^SUBJ)(^OBJ)>' |
(^ PRED) = 'devour<(^OBJ)(^OBL)>' }"
@VPRES
@BARE-AGR.
devours V * @(TRANS devour)
@VPRES
@S-AGR.
devoured V * @(TRANS devour)
{ @VPAST | @PASTP}.
gave V * @(DITRANS give)
@VPAST.
gives V * @(DITRANS give)
@VPRES
@S-AGR.
given V * @(DITRANS give)
{ @VPAST | @PASTP}.
appears V * @(INTRANS appear)
@VPRES
@S-AGR.
appeared V * @(INTRANS appear)
@VPAST.
sleeps V * @(INTRANS sleep)
@VPRES
@S-AGR.
sleep V * @(INTRANS sleep)
@VPRES
@BARE-AGR.
slept V * @(INTRANS sleep)
@VPAST.
waited V * { @(INTRANS wait) |
@(INTRANS-OBL wait)
"this is the non-semantic OBL wait on a customer use"
(^ OBL PFORM) =c on
(^ PSEM) =c nosem }
@VPAST.
"adjectives"
small A * @(PRED small).
smart A * @(PRED smart).
grey A * @(PRED grey).
"adverbs"
quickly ADV * @(PRED quickly).
very ADV * @(PRED very).
"prepositions"
by P * @(PREP by).
to P * @(PREP to).
on P * @(PREP on).
in P * @(PREP in).
with P * @(PREP with).
"auxiliaries"
was AUX * @(TENSE past)
{ (^ SUBJ PERS) = 1
| (^ SUBJ PERS) = 3
}
(^ SUBJ NUM) = sg.
"pronouns (not complete)"
I PRON * @(PRON I 1 sg pers)
@(CASE nom).
You PRON * {@(PRON you 2 sg pers)
|@(PRON you 2 pl pers)}.
you PRON * {@(PRON you 2 sg pers)
|@(PRON you 2 pl pers)}.
He PRON * @(PRON he 3 sg pers)
@(CASE nom).
he PRON * @(PRON he 3 sg pers)
@(CASE nom).
She PRON * @(PRON she 3 sg pers)
@(CASE nom).
she PRON * @(PRON she 3 sg pers)
@(CASE nom).
it PRON * @(PRON it 3 sg pers).
We PRON * @(PRON we 1 pl pers)
@(CASE nom).
we PRON * @(PRON we 1 pl pers)
@(CASE nom).
They PRON * @(PRON they 3 pl pers)
@(CASE nom).
they PRON * @(PRON they 3 pl pers)
@(CASE nom).
My PRON * @(PRON my 1 sg poss).
my PRON * @(PRON my 1 sg poss).
Her PRON * @(PRON her 3 sg poss).
her PRON * @(PRON her 3 sg poss).
Him PRON * @(PRON he 3 sg pers)
@(CASE acc).
him PRON * @(PRON he 3 sg pers)
@(CASE acc).
"determiners"
the D * (^DEF) = +.
The D * (^DEF) = +.
a D * (^ DEF) = - "this indefinite only marks singulars"
(^ NUM) = sg.
"punctuation, now with some functional information"
. PERIOD * (^ STMT-TYPE) = declarative.
, COMMA * .
! EXCL * (^ STMT-TYPE) = exclamation.
----