introduced contracted auxiliaries in English. So far only available internally in the tables created from Cl. TODO: make them accessible on top level in Extra; use them as variants in Parse. Also the use in QCl needs some more work: we can say "he's here", "I'm here", "where's he" but not "'s he here", "where'm I".

This commit is contained in:
aarne
2013-12-03 13:54:57 +00:00
parent e0ded7e7e8
commit 302e2d3ebd
8 changed files with 103 additions and 55 deletions

View File

@@ -127,7 +127,7 @@ concrete CatEng of Cat = CommonX - [Pol] ** open ResEng, Prelude in {
linref
SSlash = \ss -> ss.s ++ ss.c2 ;
ClSlash = \cls -> cls.s ! Pres ! Simul ! CPos ! ODir ++ cls.c2 ;
ClSlash = \cls -> cls.s ! Pres ! Simul ! CPos ! oDir ++ cls.c2 ;
VP = \vp -> infVP VVAux vp Simul CPos (agrP3 Sg) ;
VPSlash = \vps -> infVP VVAux vps Simul CPos (agrP3 Sg) ++ vps.c2;

View File

@@ -15,11 +15,11 @@ concrete ExtraEng of ExtraEngAbs = CatEng **
StrandRelSlash rp slash = {
s = \\t,a,p,ag =>
rp.s ! RC (fromAgr ag).g NPAcc ++ slash.s ! t ! a ! p ! ODir ++ slash.c2 ;
rp.s ! RC (fromAgr ag).g NPAcc ++ slash.s ! t ! a ! p ! oDir ++ slash.c2 ;
c = NPAcc
} ;
EmptyRelSlash slash = {
s = \\t,a,p,_ => slash.s ! t ! a ! p ! ODir ++ slash.c2 ;
s = \\t,a,p,_ => slash.s ! t ! a ! p ! oDir ++ slash.c2 ;
c = NPAcc
} ;
@@ -77,7 +77,7 @@ concrete ExtraEng of ExtraEngAbs = CatEng **
MkVPS t p vp = {
s = \\a =>
let
verb = vp.s ! t.t ! t.a ! p.p ! ODir ! a ;
verb = vp.s ! t.t ! t.a ! p.p ! oDir ! a ;
verbf = verb.aux ++ verb.adv ++ verb.fin ++ verb.inf ;
in t.s ++ p.s ++ vp.ad ++ verbf ++ vp.p ++ vp.s2 ! a ++ vp.ext
} ;
@@ -187,7 +187,7 @@ lin
--- obsolete: use UncNeg : Pol
UncNegCl t p cl = {
s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! unc p.p ! ODir
s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! unc p.p ! oDir
} ;
UncNegQCl t p cl = {
s = \\q => t.s ++ p.s ++ cl.s ! t.t ! t.a ! unc p.p ! q

View File

@@ -90,7 +90,7 @@ lin
compl = vp.s2 ! np.a
in
case o of {
ODir => compl ++ frontComma ++ np.s ! npNom ++ verb.aux ++ vp.ad ++ verb.fin ++ verb.adv ++ verb.inf ;
ODir _ => compl ++ frontComma ++ np.s ! npNom ++ verb.aux ++ vp.ad ++ verb.fin ++ verb.adv ++ verb.inf ;
OQuest => verb.aux ++ compl ++ frontComma ++ np.s ! npNom ++ verb.adv ++ vp.ad ++ verb.fin ++ verb.inf
}
} ;
@@ -102,7 +102,7 @@ lin
compl = vp.s2 ! np.a
in
case o of {
ODir => compl ++ frontComma ++ verb.aux ++ verb.adv ++ vp.ad ++ verb.fin ++ verb.inf ++ np.s ! npNom ;
ODir _ => compl ++ frontComma ++ verb.aux ++ verb.adv ++ vp.ad ++ verb.fin ++ verb.inf ++ np.s ! npNom ;
OQuest => verb.aux ++ compl ++ verb.adv ++ vp.ad ++ verb.fin ++ verb.inf ++ np.s ! npNom
}
} ;

View File

@@ -9,13 +9,13 @@ concrete QuestionEng of Question = CatEng ** open ResEng, Prelude in {
let cls = cl.s ! t ! a ! p
in table {
QDir => cls ! OQuest ;
QIndir => "if" ++ cls ! ODir
QIndir => "if" ++ cls ! oDir ----
} ---- "whether" in ExtEng
} ;
QuestVP qp vp =
let cl = mkClause (qp.s ! npNom) (agrP3 qp.n) vp
in {s = \\t,a,b,_ => cl.s ! t ! a ! b ! ODir} ;
in {s = \\t,a,b,_ => cl.s ! t ! a ! b ! oDir} ; ----
QuestSlash ip slash =
mkQuestion (ss (slash.c2 ++ ip.s ! NPAcc)) slash ;
@@ -63,7 +63,7 @@ concrete QuestionEng of Question = CatEng ** open ResEng, Prelude in {
QuestQVP qp vp =
let cl = mkClause (qp.s ! npNom) (agrP3 qp.n) vp
in {s = \\t,a,b,_ => cl.s ! t ! a ! b ! ODir} ;
in {s = \\t,a,b,_ => cl.s ! t ! a ! b ! oDir} ; ----
}

View File

@@ -5,7 +5,7 @@ concrete RelativeEng of Relative = CatEng ** open ResEng in {
lin
RelCl cl = {
s = \\t,a,p,_ => "such" ++ "that" ++ cl.s ! t ! a ! p ! ODir ;
s = \\t,a,p,_ => "such" ++ "that" ++ cl.s ! t ! a ! p ! oDir ;
c = npNom
} ;
@@ -18,7 +18,7 @@ concrete RelativeEng of Relative = CatEng ** open ResEng in {
} ;
cl = mkClause (rp.s ! RC (fromAgr agr).g npNom) agr vp
in
cl.s ! t ! ant ! b ! ODir ;
cl.s ! t ! ant ! b ! oDir ;
c = npNom
} ;
@@ -28,7 +28,7 @@ concrete RelativeEng of Relative = CatEng ** open ResEng in {
RelSlash rp slash = {
s = \\t,a,p,agr =>
slash.c2 ++ rp.s ! RPrep (fromAgr agr).g ++ slash.s ! t ! a ! p ! ODir ;
slash.c2 ++ rp.s ! RPrep (fromAgr agr).g ++ slash.s ! t ! a ! p ! oDir ;
c = NPAcc
} ;

View File

@@ -64,12 +64,18 @@ resource ResEng = ParamX ** open Prelude in {
| VVPastNeg --# notpresent
;
-- The order of sentence is needed already in $VP$.
-- The order of sentence is needed already in $VP$ because the need of "do" depends on it.
-- $ODir True$ means contracted forms ("'s", "'d", "'ve". "'re").
-- Notice that inverted forms ($OQuest$) don't allow verb contractions: *"'s he arrived".
Order = ODir | OQuest ;
Order = ODir Bool | OQuest ;
oper
oDir = ODir False ;
-- The type of complement of a VV
param
VVType = VVAux | VVInf | VVPresPart ; -- can do / try to do / start doing
--2 For $Adjective$
@@ -240,6 +246,8 @@ resource ResEng = ParamX ** open Prelude in {
predVc : (Verb ** {c2 : Str}) -> SlashVP = \verb ->
predV verb ** {c2 = verb.c2 ; gapInMiddle = True} ;
cBind : Str -> Str = \s -> Predef.BIND ++ ("'" + s) ;
predV : Verb -> VP = \verb -> {
s = \\t,ant,b,ord,agr =>
let
@@ -248,24 +256,36 @@ resource ResEng = ParamX ** open Prelude in {
part = verb.s ! VPPart ;
in
case <t,ant,b,ord> of {
<Pres,Simul,CPos,ODir> => vff fin [] ;
<Pres,Simul,CPos,OQuest> => vf (does agr) inf ;
<Pres,Anter,CPos,_> => vf (have agr) part ; --# notpresent
<Pres,Anter,CNeg c,_> => vfn c (have agr) (havent agr) part ; --# notpresent
<Past,Simul,CPos,ODir> => vff (verb.s ! VPast) [] ; --# notpresent
<Past,Simul,CPos,OQuest> => vf "did" inf ; --# notpresent
<Past,Simul,CNeg c,_> => vfn c "did" "didn't" inf ; --# notpresent
<Past,Anter,CPos,_> => vf "had" part ; --# notpresent
<Past,Anter,CNeg c,_> => vfn c "had" "hadn't" part ; --# notpresent
<Fut, Simul,CPos,_> => vf "will" inf ; --# notpresent
<Fut, Simul,CNeg c,_> => vfn c "will" "won't" inf ; --# notpresent
<Fut, Anter,CPos,_> => vf "will" ("have" ++ part) ; --# notpresent
<Fut, Anter,CNeg c,_> => vfn c "will" "won't"("have" ++ part) ; --# notpresent
<Cond,Simul,CPos,_> => vf "would" inf ; --# notpresent
<Cond,Simul,CNeg c,_> => vfn c "would" "wouldn't" inf ; --# notpresent
<Cond,Anter,CPos,_> => vf "would" ("have" ++ part) ; --# notpresent
<Cond,Anter,CNeg c,_> => vfn c "would" "wouldn't" ("have" ++ part) ; --# notpresent
<Pres,Simul,CNeg c,_> => vfn c (does agr) (doesnt agr) inf
<Pres,Simul,CPos,ODir _> => vff fin [] ;
<Pres,Simul,CPos,OQuest> => vf (does agr) inf ;
<Pres,Anter,CPos,ODir True> => vf (haveContr agr) part ; --# notpresent
<Pres,Anter,CPos,_> => vf (have agr) part ; --# notpresent
<Pres,Anter,CNeg c,ODir True> => vfn c (haveContr agr) (haventContr agr) part ; --# notpresent
<Pres,Anter,CNeg c,_> => vfn c (have agr) (havent agr) part ; --# notpresent
<Past,Simul,CPos,ODir _> => vff (verb.s ! VPast) [] ; --# notpresent
<Past,Simul,CPos,OQuest> => vf "did" inf ; --# notpresent
<Past,Simul,CNeg c,_> => vfn c "did" "didn't" inf ; --# notpresent
<Past,Anter,CPos,ODir True> => vf (cBind "d") part ; --# notpresent
<Past,Anter,CPos,_> => vf "had" part ; --# notpresent
<Past,Anter,CNeg c,ODir True> => vfn c (cBind "d") (cBind "d not") part ; --# notpresent
<Past,Anter,CNeg c,_> => vfn c "had" "hadn't" part ; --# notpresent
<Fut, Simul,CPos,ODir True> => vf (cBind "ll") inf ; --# notpresent
<Fut, Simul,CPos,_> => vf "will" inf ; --# notpresent
<Fut, Simul,CNeg c,ODir True> => vfn c (cBind "ll") (cBind "ll not") inf ; --# notpresent
<Fut, Simul,CNeg c,_> => vfn c "will" "won't" inf ; --# notpresent
<Fut, Anter,CPos,ODir True> => vf (cBind "ll") ("have" ++ part) ; --# notpresent
<Fut, Anter,CPos,_> => vf "will" ("have" ++ part) ; --# notpresent
<Fut, Anter,CNeg c,ODir True> => vfn c (cBind "ll") (cBind "ll not") ("have" ++ part) ; --# notpresent
<Fut, Anter,CNeg c,_> => vfn c "will" "won't" ("have" ++ part) ; --# notpresent
<Cond,Simul,CPos,ODir True> => vf (cBind "d") inf ; --# notpresent
<Cond,Simul,CPos,_> => vf "would" inf ; --# notpresent
<Cond,Simul,CNeg c,ODir True> => vfn c (cBind "d") (cBind "d not") inf ; --# notpresent
<Cond,Simul,CNeg c,_> => vfn c "would" "wouldn't" inf ; --# notpresent
<Cond,Anter,CPos,ODir True> => vf (cBind "d") ("have" ++ part) ; --# notpresent
<Cond,Anter,CPos,_> => vf "would" ("have" ++ part) ; --# notpresent
<Cond,Anter,CNeg c,ODir True> => vfn c (cBind "d") (cBind "d not") ("have" ++ part) ; --# notpresent
<Cond,Anter,CNeg c,_> => vfn c "would" "wouldn't" ("have" ++ part) ; --# notpresent
<Pres,Simul,CNeg c,_> => vfn c (does agr) (doesnt agr) inf
} ;
p = verb.p ;
prp = verb.s ! VPresPart ;
@@ -286,25 +306,44 @@ resource ResEng = ParamX ** open Prelude in {
inf = verb.inf ;
fin = verb.pres ! b ! agr ;
finp = verb.pres ! Pos ! agr ;
cfin = verb.contr ! b ! agr ;
cfinp = verb.contr ! Pos ! agr ;
part = verb.ppart ;
in
case <t,ant,cb,ord> of {
<Pres,Anter,CPos,_> => vf (have agr) part ; --# notpresent
<Pres,Anter,CNeg c,_> => vfn c (have agr) (havent agr) part ; --# notpresent
<Pres,Anter,CPos,ODir True> => vf (haveContr agr) part ; --# notpresent
<Pres,Anter,CPos,_> => vf (have agr) part ; --# notpresent
<Pres,Anter,CNeg c,ODir True> => vfn c (haveContr agr) (haventContr agr) part ; --# notpresent
<Pres,Anter,CNeg c,_> => vfn c (have agr) (havent agr) part ; --# notpresent
<Past,Anter,CPos,ODir True> => vf (cBind "d") part ; --# notpresent
<Past,Anter,CPos,_> => vf "had" part ; --# notpresent
<Past,Anter,CNeg c,ODir True> => vfn c (cBind "d") (cBind "d not") part ; --# notpresent
<Past,Anter,CNeg c,_> => vfn c "had" "hadn't" part ; --# notpresent
<Fut, Simul,CPos,ODir True> => vf (cBind "ll") inf ; --# notpresent
<Fut, Simul,CPos,_> => vf "will" inf ; --# notpresent
<Fut, Simul,CNeg c,ODir True> => vfn c (cBind "ll") (cBind "ll not") inf ; --# notpresent
<Fut, Simul,CNeg c,_> => vfn c "will" "won't" inf ; --# notpresent
<Fut, Anter,CPos,ODir True> => vf (cBind "ll") ("have" ++ part) ; --# notpresent
<Fut, Anter,CPos,_> => vf "will" ("have" ++ part) ; --# notpresent
<Fut, Anter,CNeg c,ODir True> => vfn c (cBind "ll") (cBind "ll not") ("have" ++ part) ; --# notpresent
<Fut, Anter,CNeg c,_> => vfn c "will" "won't"("have" ++ part) ; --# notpresent
<Cond,Simul,CPos,ODir True> => vf (cBind "d") inf ; --# notpresent
<Cond,Simul,CPos,_> => vf "would" inf ; --# notpresent
<Cond,Simul,CNeg c,ODir True> => vfn c (cBind "d") (cBind "d not") inf ; --# notpresent
<Cond,Simul,CNeg c,_> => vfn c "would" "wouldn't" inf ; --# notpresent
<Cond,Anter,CPos,ODir True> => vf (cBind "d") ("have" ++ part) ; --# notpresent
<Cond,Anter,CPos,_> => vf "would" ("have" ++ part) ; --# notpresent
<Cond,Anter,CNeg c,ODir True> => vfn c (cBind "d") (cBind "d not") ("have" ++ part) ; --# notpresent
<Cond,Anter,CNeg c,_> => vfn c "would" "wouldn't" ("have" ++ part) ; --# notpresent
<Past,Simul,CPos, _> => vf (verb.past ! b ! agr) [] ; --# notpresent
<Past,Simul,CNeg c, _> => vfn c (verb.past!Pos!agr)(verb.past!Neg!agr) [] ; --# notpresent
<Past,Anter,CPos,_> => vf "had" part ; --# notpresent
<Past,Anter,CNeg c,_> => vfn c "had" "hadn't" part ; --# notpresent
<Fut, Simul,CPos,_> => vf "will" inf ; --# notpresent
<Fut, Simul,CNeg c,_> => vfn c "will" "won't" inf ; --# notpresent
<Fut, Anter,CPos,_> => vf "will" ("have" ++ part) ; --# notpresent
<Fut, Anter,CNeg c,_> => vfn c "will" "won't"("have" ++ part) ; --# notpresent
<Cond,Simul,CPos,_> => vf "would" inf ; --# notpresent
<Cond,Simul,CNeg c,_> => vfn c "would" "wouldn't" inf ; --# notpresent
<Cond,Anter,CPos,_> => vf "would" ("have" ++ part) ; --# notpresent
<Cond,Anter,CNeg c,_> => vfn c "would" "wouldn't" ("have" ++ part) ; --# notpresent
<Pres,Simul,CPos, _> => vf fin [] ;
<Pres,Simul,CNeg c, _> => vfn c finp fin []
<Pres,Simul,CPos, ODir True> => vf cfin [] ;
<Pres,Simul,CPos, _> => vf fin [] ;
<Pres,Simul,CNeg c,ODir True> => vfn c cfinp fin [] ;
<Pres,Simul,CNeg c, _> => vfn c finp fin []
} ;
p = [] ;
prp = verb.prpart ;
@@ -397,7 +436,7 @@ resource ResEng = ParamX ** open Prelude in {
in
case verb.typ of {
VVAux => predAux {
pres = table {
pres,contr = table {
Pos => \\_ => verbs ! VVF VPres ;
Neg => \\_ => verbs ! VVPresNeg
} ;
@@ -443,9 +482,13 @@ resource ResEng = ParamX ** open Prelude in {
does = agrVerb "does" "do" ;
doesnt = agrVerb "doesn't" "don't" ;
haveContr = agrVerb (cBind "s") (cBind "ve") ;
haventContr = agrVerb (cBind "s not") (cBind "ve not") ;
Aux = {
pres : Polarity => Agr => Str ;
past : Polarity => Agr => Str ; --# notpresent
pres : Polarity => Agr => Str ;
contr : Polarity => Agr => Str ; -- contracted forms
past : Polarity => Agr => Str ; --# notpresent
inf,ppart,prpart : Str
} ;
@@ -455,6 +498,11 @@ resource ResEng = ParamX ** open Prelude in {
<Neg,AgP1 Sg> => ["am not"] ; --- am not I
_ => agrVerb (posneg b "is") (posneg b "are") a
} ;
contr = \\b,a => case <b,a> of {
<Pos,AgP1 Sg> => cBind "m" ;
<Neg,AgP1 Sg> => cBind "m not" ; --- am not I
_ => agrVerb (posneg b (cBind "s")) (posneg b (cBind "re")) a
} ;
past = \\b,a => case a of { --# notpresent
AgP1 Sg | AgP3Sg _ => posneg b "was" ; --# notpresent
_ => (posneg b "were") --# notpresent
@@ -496,7 +544,7 @@ resource ResEng = ParamX ** open Prelude in {
compl = vp.s2 ! agr ++ vp.ext
in
case o of {
ODir => subj ++ verb.aux ++ verb.adv ++ vp.ad ++ verb.fin ++ verb.inf ++ vp.p ++ compl ;
ODir _ => subj ++ verb.aux ++ verb.adv ++ vp.ad ++ verb.fin ++ verb.inf ++ vp.p ++ compl ;
OQuest => verb.aux ++ subj ++ verb.adv ++ vp.ad ++ verb.fin ++ verb.inf ++ vp.p ++ compl
}
} ;
@@ -539,7 +587,7 @@ resource ResEng = ParamX ** open Prelude in {
why = wh.s
in table {
QDir => why ++ cls ! OQuest ;
QIndir => why ++ cls ! ODir
QIndir => why ++ cls ! oDir ---- enable "why he's here"
}
} ;

View File

@@ -42,7 +42,7 @@ concrete SentenceEng of Sentence = CatEng ** open Prelude, ResEng in {
EmbedVP vp = {s = infVP VVInf vp Simul CPos (agrP3 Sg)} ; --- agr
UseCl t p cl = {
s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! ctr p.p ! ODir
s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! ctr p.p ! oDir
} ;
UseQCl t p cl = {
s = \\q => t.s ++ p.s ++ cl.s ! t.t ! t.a ! ctr p.p ! q
@@ -52,7 +52,7 @@ concrete SentenceEng of Sentence = CatEng ** open Prelude, ResEng in {
c = cl.c
} ;
UseSlash t p cl = {
s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! ctr p.p ! ODir ;
s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! ctr p.p ! oDir ;
c2 = cl.c2
} ;

View File

@@ -29,7 +29,7 @@ concrete StructuralEng of Structural = CatEng **
VVF VPresPart => ["being able to"] ;
VVF VPast => "could" ; --# notpresent
VVPastNeg => "couldn't" ; --# notpresent
VVPresNeg => "can't"
VVPresNeg => "can't" | "cannot" ---- shouldn't be a variant, but replace "can not"
} ;
p = [] ;
typ = VVAux