mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-09 04:59:31 -06:00
bug fix in PredEng VV forms
This commit is contained in:
@@ -7,7 +7,11 @@ concrete LiftEng of Lift =
|
||||
--flags literal=Symb ;
|
||||
|
||||
oper
|
||||
liftV : ResEng.Verb -> Pr.PrV = \v -> lin PrV {s = v.s ; p = v.p ; c1,c2 = [] ; isSubjectControl = True ; vtype = VTAct ; vvtype = VVInf} ;
|
||||
liftV : ResEng.Verb -> Pr.PrV = \v -> lin PrV {
|
||||
s = table {VVF f => v.s ! f ; VVPresNeg | VVPastNeg => v.s ! VInf} ; ---- only used for Aux
|
||||
p = v.p ;
|
||||
c1,c2 = [] ; isSubjectControl = True ; vtype = VTAct ; vvtype = VVInf
|
||||
} ;
|
||||
|
||||
lin
|
||||
LiftV v = liftV v ;
|
||||
@@ -16,8 +20,8 @@ lin
|
||||
LiftVQ v = liftV v ;
|
||||
LiftVA v = liftV v ; ---- c1?
|
||||
LiftVN v = liftV v ; ---- c1?
|
||||
LiftVV v = {s = \\f => v.s ! VVF f ; p = v.p ; c1,c2 = [] ; isSubjectControl = True ;
|
||||
vtype = case v.typ of {VAux => VTAux ; _ => VTAct} ; vvtype = v.typ} ; ---- c1? ---- VVF
|
||||
LiftVV v = {s = v.s ; p = v.p ; c1,c2 = [] ; isSubjectControl = True ;
|
||||
vtype = case v.typ of {VVAux => VTAux ; _ => VTAct} ; vvtype = v.typ} ; ---- c1? ---- VVF
|
||||
|
||||
LiftV3 v = liftV v ** {c1 = v.c2 ; c2 = v.c3} ;
|
||||
LiftV2S v = liftV v ** {c1 = v.c2} ;
|
||||
|
||||
@@ -29,7 +29,6 @@ lin
|
||||
obj1 = vp.part ++ strComplCase vp.c1 ++ vp.obj1.p1 ! rpa ; ---- apply complCase ---- place of part depends on obj
|
||||
obj2 = strComplCase vp.c2 ++ vp.obj2.p1 ! (case vp.obj2.p2 of {True => rpa ; False => vp.obj1.p2}) ; ---- apply complCase
|
||||
c3 = noComplCase ; -- for one more prep to build ClSlash
|
||||
qforms = qformsVP vp (agr2vagr rpa) ;
|
||||
}
|
||||
in {s = declCl cl ; c = subjCase} ;
|
||||
|
||||
@@ -47,7 +46,6 @@ lin
|
||||
obj1 = vp.part ++ strComplCase vp.c1 ++ vp.obj1.p1 ! npa ; ---- apply complCase ---- place of part depends on obj
|
||||
obj2 = strComplCase vp.c2 ++ vp.obj2.p1 ! npa ;
|
||||
c3 = vp.c1 ; -- in case there is any free slot left ---- could be c2
|
||||
qforms = qformsVP vp (agr2vagr npa) ;
|
||||
} ;
|
||||
|
||||
StartVPC x c v w = { ---- some loss of quality seems inevitable
|
||||
@@ -112,7 +110,6 @@ lin
|
||||
adv = vp.adv ;
|
||||
adV = vp.adV ;
|
||||
ext = vp.ext ;
|
||||
qforms = qformsVP vp (ipagr2vagr UUnit) ;
|
||||
} ;
|
||||
|
||||
QuestSlash x ip cl =
|
||||
|
||||
@@ -15,6 +15,7 @@ concrete PredFin of Pred =
|
||||
-- overridden
|
||||
,UseV
|
||||
,UseAP
|
||||
,UseNP
|
||||
,UseCN
|
||||
,QuestVP
|
||||
,PredVP
|
||||
@@ -36,6 +37,10 @@ lin
|
||||
adj = \\a => ap.s ! agr2aagr a ;
|
||||
} ;
|
||||
|
||||
UseNP a t p np = useCopula a t p ** {
|
||||
adj = \\a => np.s ! subjCase ;
|
||||
} ;
|
||||
|
||||
UseCN x a t p cn = useCopula a t p ** {
|
||||
c1 = cn.c1 ;
|
||||
c2 = cn.c2 ;
|
||||
|
||||
@@ -114,9 +114,6 @@ oper
|
||||
impVP : Number -> PrVerbPhrase -> Str = \n,vp ->
|
||||
infVP UUnit UUnit vp ;
|
||||
|
||||
qformsV : Str -> STense -> Anteriority -> Polarity -> VAgr -> PrVerb -> Str * Str =
|
||||
\sta,t,a,p,agr,v -> <[],[]> ; ----- not needed in Chinese
|
||||
|
||||
|
||||
declCl : PrClause -> Str = \cl -> cl.subj ++ cl.v.p1 ++ cl.adV ++ cl.adv ++ cl.v.p2 ++ restCl cl ;
|
||||
declSubordCl : PrClause -> Str = declCl ;
|
||||
|
||||
@@ -55,7 +55,7 @@ oper
|
||||
Agr = ResEng.Agr ;
|
||||
Case = ResEng.Case ;
|
||||
NPCase = ResEng.NPCase ;
|
||||
VForm = ResEng.VForm ; ---- VVForm to get contracted aux verbs
|
||||
VForm = ResEng.VVForm ; ---- VVForm to get contracted aux verbs
|
||||
VVType = ResEng.VVType ;
|
||||
SVoice = Voice ;
|
||||
|
||||
@@ -138,8 +138,8 @@ oper
|
||||
VAPl => AgP3Pl
|
||||
} ;
|
||||
|
||||
vPastPart : PrVerb -> AAgr -> Str = \v,_ -> v.s ! VPPart ;
|
||||
vPresPart : PrVerb -> AAgr -> Str = \v,_ -> v.s ! VPresPart ;
|
||||
vPastPart : PrVerb -> AAgr -> Str = \v,_ -> v.s ! VVF VPPart ;
|
||||
vPresPart : PrVerb -> AAgr -> Str = \v,_ -> v.s ! VVF VPresPart ;
|
||||
|
||||
vvInfinitive : VVType = VVInf ;
|
||||
|
||||
@@ -205,7 +205,7 @@ oper
|
||||
-} ;
|
||||
|
||||
tenseActV : Str -> STense -> Anteriority -> Polarity -> VAgr -> PrVerb -> Str * Str * Str = \sta,t,a,p,agr,v ->
|
||||
let vt : VForm = case <t,agr> of {
|
||||
let vt : ResEng.VForm = case <t,agr> of {
|
||||
<Pres,VASgP3> => VPres ;
|
||||
<Past|Cond,_ > => VPast ;
|
||||
_ => VInf
|
||||
@@ -215,55 +215,58 @@ oper
|
||||
<Pres|Past, Simul> =>
|
||||
case v.vtype of {
|
||||
VTAux => case t of {
|
||||
Pres => <sta ++ v.s ! VPres, [], []> ; -- can I/she/we
|
||||
_ => <sta ++ v.s ! vt, [], []> -- could ...
|
||||
Pres => <sta ++ v.s ! VVF VPres, not_Str p, []> ; -- can I/she/we
|
||||
_ => <sta ++ v.s ! VVF vt, not_Str p, []> -- could ...
|
||||
} ;
|
||||
_ => case p of {
|
||||
Pos => <[], sta ++ v.s ! vt, []> ; -- this is the deviating case
|
||||
Neg => <do_Aux vt Pos, not_Str p, sta ++ v.s ! VInf>
|
||||
Pos => <[], sta ++ v.s ! VVF vt, []> ; -- this is the deviating case
|
||||
Neg => <do_Aux vt Pos, not_Str p, sta ++ v.s ! VVF VInf>
|
||||
}
|
||||
} ;
|
||||
|
||||
<Pres|Past, Anter> => <have_Aux vt Pos, not_Str p, sta ++ v.s ! VPPart> ;
|
||||
<Fut|Cond, Simul> => <will_Aux vt Pos, not_Str p, sta ++ v.s ! VInf> ;
|
||||
<Fut|Cond, Anter> => <will_Aux vt Pos, not_Str p ++ have_Aux VInf Pos, sta ++ v.s ! VPPart>
|
||||
<Pres|Past, Anter> => <have_Aux vt Pos, not_Str p, sta ++ v.s ! VVF VPPart> ;
|
||||
<Fut|Cond, Simul> => <will_Aux vt Pos, not_Str p, sta ++ v.s ! VVF VInf> ;
|
||||
<Fut|Cond, Anter> => <will_Aux vt Pos, not_Str p ++ have_Aux VInf Pos, sta ++ v.s ! VVF VPPart>
|
||||
} ;
|
||||
|
||||
tenseActVContracted : Str -> STense -> Anteriority -> Polarity -> VAgr -> PrVerb -> Str * Str * Str = \sta,t,a,p,agr,v ->
|
||||
let vt : VForm = case <t,agr> of {
|
||||
<Pres,VASgP3> => VPres ;
|
||||
<Past|Cond,_ > => VPast ;
|
||||
_ => VInf
|
||||
let vt : ResEng.VForm * VVForm = case <t,agr> of {
|
||||
<Pres,VASgP3> => <VPres, VVPresNeg> ;
|
||||
<Past|Cond,_ > => <VPast, VVPastNeg> ;
|
||||
_ => <VInf, VVF VInf>
|
||||
} ;
|
||||
in
|
||||
|
||||
case <t,a> of {
|
||||
<Pres|Past, Simul> =>
|
||||
case v.vtype of {
|
||||
VTAux => <sta ++ v.s ! vt, [], []> ;
|
||||
_ => case p of {
|
||||
Pos => <[], sta ++ v.s ! vt, []> ; -- this is the deviating case
|
||||
Neg => <do_Aux vt p, [], sta ++ v.s ! VInf>
|
||||
VTAux => case p of {
|
||||
Pos => <sta ++ v.s ! VVF vt.p1, [], []> ;
|
||||
Neg => <sta ++ v.s ! vt.p2, [], []>
|
||||
} ;
|
||||
_ => case p of {
|
||||
Pos => <[], sta ++ v.s ! VVF vt.p1, []> ; -- this is the deviating case
|
||||
Neg => <do_Aux vt.p1 p, [], sta ++ v.s ! VVF VInf>
|
||||
}
|
||||
} ;
|
||||
<Pres|Past, Anter> => <have_AuxC vt p, [], sta ++ v.s ! VPPart>
|
||||
| <have_AuxC vt Pos, not_Str p, sta ++ v.s ! VPPart> ;
|
||||
<Fut|Cond, Simul> => <will_AuxC vt p, [], sta ++ v.s ! VInf>
|
||||
| <will_AuxC vt Pos, not_Str p, sta ++ v.s ! VInf> ;
|
||||
<Fut|Cond, Anter> => <will_AuxC vt p, have_Aux VInf Pos, sta ++ v.s ! VPPart>
|
||||
| <will_AuxC vt Pos, not_Str p ++ have_Aux VInf Pos, sta ++ v.s ! VPPart>
|
||||
<Pres|Past, Anter> => <have_AuxC vt.p1 p, [], sta ++ v.s ! VVF VPPart>
|
||||
| <have_AuxC vt.p1 Pos, not_Str p, sta ++ v.s ! VVF VPPart> ;
|
||||
<Fut|Cond, Simul> => <will_AuxC vt.p1 p, [], sta ++ v.s ! VVF VInf>
|
||||
| <will_AuxC vt.p1 Pos, not_Str p, sta ++ v.s ! VVF VInf> ;
|
||||
<Fut|Cond, Anter> => <will_AuxC vt.p1 p, have_Aux VInf Pos, sta ++ v.s ! VVF VPPart>
|
||||
| <will_AuxC vt.p1 Pos, not_Str p ++ have_Aux VInf Pos, sta ++ v.s ! VVF VPPart>
|
||||
} ;
|
||||
|
||||
tensePassV : Str -> STense -> Anteriority -> Polarity -> VAgr -> PrVerb -> Str * Str * Str = \sta,t,a,p,agr,v ->
|
||||
let
|
||||
be = be_AuxL sta t a p agr ;
|
||||
done = v.s ! VPPart
|
||||
done = v.s ! VVF VPPart
|
||||
in
|
||||
<be.p1, be.p2, be.p3 ++ done> ;
|
||||
tensePassVContracted : Str -> STense -> Anteriority -> Polarity -> VAgr -> PrVerb -> Str * Str * Str = \sta,t,a,p,agr,v ->
|
||||
let
|
||||
be = be_AuxC sta t a p agr ;
|
||||
done = v.s ! VPPart
|
||||
done = v.s ! VVF VPPart
|
||||
in
|
||||
<be.p1, be.p2, be.p3 ++ done> ;
|
||||
|
||||
@@ -274,25 +277,25 @@ oper
|
||||
case vt of {
|
||||
VVInf =>
|
||||
case a of {
|
||||
Simul => not ++ "to" ++ sa ++ v.s ! VInf ; -- (she wants) (not) to sleep
|
||||
Anter => not ++ "to" ++ have_Aux VInf Pos ++ sa ++ v.s ! VPPart -- (she wants) (not) to have slept
|
||||
Simul => not ++ "to" ++ sa ++ v.s ! VVF VInf ; -- (she wants) (not) to sleep
|
||||
Anter => not ++ "to" ++ have_Aux VInf Pos ++ sa ++ v.s ! VVF VPPart -- (she wants) (not) to have slept
|
||||
} ;
|
||||
VVAux =>
|
||||
case a of {
|
||||
Simul => not ++ sa ++ v.s ! VInf ; -- (she must) (not) sleep
|
||||
Anter => not ++ have_Aux VInf Pos ++ sa ++ v.s ! VPPart -- (she must) (not) have slept
|
||||
Simul => not ++ sa ++ v.s ! VVF VInf ; -- (she must) (not) sleep
|
||||
Anter => not ++ have_Aux VInf Pos ++ sa ++ v.s ! VVF VPPart -- (she must) (not) have slept
|
||||
} ;
|
||||
VVPresPart =>
|
||||
case a of {
|
||||
Simul => not ++ sa ++ v.s ! VPresPart ; -- (she starts) (not) sleeping
|
||||
Anter => not ++ "having" ++ sa ++ v.s ! VPPart -- (she starts) (not) having slept
|
||||
Simul => not ++ sa ++ v.s ! VVF VPresPart ; -- (she starts) (not) sleeping
|
||||
Anter => not ++ "having" ++ sa ++ v.s ! VVF VPPart -- (she starts) (not) having slept
|
||||
}
|
||||
} ;
|
||||
|
||||
imperativeV : Str -> Polarity -> ImpType -> PrVerb -> Str = \s,p,it,v ->
|
||||
s ++ case p of {
|
||||
Pos => v.s ! VInf ;
|
||||
Neg => ("do not" | "don't") ++ v.s ! VInf
|
||||
Pos => v.s ! VVF VInf ;
|
||||
Neg => ("do not" | "don't") ++ v.s ! VVF VInf
|
||||
} ;
|
||||
|
||||
|
||||
@@ -373,11 +376,13 @@ oper
|
||||
oper
|
||||
be_V : PrVerb = {
|
||||
s = table {
|
||||
VInf => "be" ;
|
||||
VPres => "is" ;
|
||||
VPast => "was" ;
|
||||
VPPart => "been" ;
|
||||
VPresPart => "being"
|
||||
VVF VInf => "be" ;
|
||||
VVF VPres => "is" ;
|
||||
VVF VPast => "was" ;
|
||||
VVF VPPart => "been" ;
|
||||
VVF VPresPart => "being" ;
|
||||
VVPresNeg => "isn't" ;
|
||||
VVPastNeg => "wasn't"
|
||||
} ;
|
||||
p,c1,c2 = [] ; vtype = VTAux ; vvtype = VVInf ; isSubjectControl = False
|
||||
} ;
|
||||
@@ -389,20 +394,20 @@ oper
|
||||
|
||||
oper
|
||||
---- have to split the tables to two to get reasonable PMCFG generation
|
||||
will_Aux : VForm -> Polarity -> Str = \vf,p -> case <vf,p> of {
|
||||
will_Aux : ResEng.VForm -> Polarity -> Str = \vf,p -> case <vf,p> of {
|
||||
<VInf|VPres, Pos> => varAux "will" "ll" ;
|
||||
<VInf|VPres, Neg> => "won't" ;
|
||||
<VPast|_ , Pos> => varAux "would" "d" ;
|
||||
<VPast|_ , Neg> => "wouldn't"
|
||||
} ;
|
||||
will_AuxC : VForm -> Polarity -> Str = \vf,p -> case <vf,p> of {
|
||||
will_AuxC : ResEng.VForm -> Polarity -> Str = \vf,p -> case <vf,p> of {
|
||||
<VInf|VPres, Pos> => varAuxC "will" "ll" ;
|
||||
<VInf|VPres, Neg> => "won't" ;
|
||||
<VPast|_ , Pos> => varAuxC "would" "d" ;
|
||||
<VPast|_ , Neg> => "wouldn't"
|
||||
} ;
|
||||
|
||||
have_Aux : VForm -> Polarity -> Str = \vf,p -> case <vf,p> of {
|
||||
have_Aux : ResEng.VForm -> Polarity -> Str = \vf,p -> case <vf,p> of {
|
||||
<VInf, Pos> => varAux "have" "ve" ; --- slightly overgenerating if used in infinitive
|
||||
<VInf, Neg> => "haven't" ;
|
||||
<VPres, Pos> => varAux "has" "s" ;
|
||||
@@ -410,7 +415,7 @@ oper
|
||||
<VPast|_ , Pos> => varAux "had" "d" ;
|
||||
<VPast|_ , Neg> => "hadn't"
|
||||
} ;
|
||||
have_AuxC : VForm -> Polarity -> Str = \vf,p -> case <vf,p> of {
|
||||
have_AuxC : ResEng.VForm -> Polarity -> Str = \vf,p -> case <vf,p> of {
|
||||
<VInf, Pos> => varAuxC "have" "ve" ; --- slightly overgenerating if used in infinitive
|
||||
<VInf, Neg> => "haven't" ;
|
||||
<VPres, Pos> => varAuxC "has" "s" ;
|
||||
@@ -419,7 +424,7 @@ oper
|
||||
<VPast|_ , Neg> => "hadn't"
|
||||
} ;
|
||||
|
||||
do_Aux : VForm -> Polarity -> Str = \vf,p -> case <vf,p> of {
|
||||
do_Aux : ResEng.VForm -> Polarity -> Str = \vf,p -> case <vf,p> of {
|
||||
<VInf, Pos> => "do" ;
|
||||
<VInf, Neg> => "don't" ;
|
||||
<VPres, Pos> => "does" ;
|
||||
|
||||
@@ -3,6 +3,7 @@ instance PredInstanceFin of
|
||||
NounPhrase,
|
||||
PrVerb, initPrVerb,
|
||||
PrVerbPhrase, initPrVerbPhrase, initPrVerbPhraseV, useCopula, linrefPrVP, qformsVP, applyVerb, addObj2VP,
|
||||
initBasePrVerbPhrase, initBasePrVerbPhraseV,
|
||||
PrClause, initPrClause
|
||||
] =
|
||||
open ResFin, (P = ParadigmsFin), (S = StemFin), (X = ParamX), Prelude in {
|
||||
|
||||
Reference in New Issue
Block a user