bug fix in PredEng VV forms

This commit is contained in:
aarne
2014-03-07 14:37:38 +00:00
parent 0e0237d5f5
commit 752a0a3607
6 changed files with 63 additions and 54 deletions

View File

@@ -7,7 +7,11 @@ concrete LiftEng of Lift =
--flags literal=Symb ; --flags literal=Symb ;
oper 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 lin
LiftV v = liftV v ; LiftV v = liftV v ;
@@ -16,8 +20,8 @@ lin
LiftVQ v = liftV v ; LiftVQ v = liftV v ;
LiftVA v = liftV v ; ---- c1? LiftVA v = liftV v ; ---- c1?
LiftVN v = liftV v ; ---- c1? LiftVN v = liftV v ; ---- c1?
LiftVV v = {s = \\f => v.s ! VVF f ; p = v.p ; c1,c2 = [] ; isSubjectControl = True ; LiftVV v = {s = v.s ; p = v.p ; c1,c2 = [] ; isSubjectControl = True ;
vtype = case v.typ of {VAux => VTAux ; _ => VTAct} ; vvtype = v.typ} ; ---- c1? ---- VVF vtype = case v.typ of {VVAux => VTAux ; _ => VTAct} ; vvtype = v.typ} ; ---- c1? ---- VVF
LiftV3 v = liftV v ** {c1 = v.c2 ; c2 = v.c3} ; LiftV3 v = liftV v ** {c1 = v.c2 ; c2 = v.c3} ;
LiftV2S v = liftV v ** {c1 = v.c2} ; LiftV2S v = liftV v ** {c1 = v.c2} ;

View File

@@ -29,7 +29,6 @@ lin
obj1 = vp.part ++ strComplCase vp.c1 ++ vp.obj1.p1 ! rpa ; ---- apply complCase ---- place of part depends on obj 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 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 c3 = noComplCase ; -- for one more prep to build ClSlash
qforms = qformsVP vp (agr2vagr rpa) ;
} }
in {s = declCl cl ; c = subjCase} ; 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 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 ; obj2 = strComplCase vp.c2 ++ vp.obj2.p1 ! npa ;
c3 = vp.c1 ; -- in case there is any free slot left ---- could be c2 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 StartVPC x c v w = { ---- some loss of quality seems inevitable
@@ -112,7 +110,6 @@ lin
adv = vp.adv ; adv = vp.adv ;
adV = vp.adV ; adV = vp.adV ;
ext = vp.ext ; ext = vp.ext ;
qforms = qformsVP vp (ipagr2vagr UUnit) ;
} ; } ;
QuestSlash x ip cl = QuestSlash x ip cl =

View File

@@ -15,6 +15,7 @@ concrete PredFin of Pred =
-- overridden -- overridden
,UseV ,UseV
,UseAP ,UseAP
,UseNP
,UseCN ,UseCN
,QuestVP ,QuestVP
,PredVP ,PredVP
@@ -36,6 +37,10 @@ lin
adj = \\a => ap.s ! agr2aagr a ; 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 ** { UseCN x a t p cn = useCopula a t p ** {
c1 = cn.c1 ; c1 = cn.c1 ;
c2 = cn.c2 ; c2 = cn.c2 ;

View File

@@ -114,9 +114,6 @@ oper
impVP : Number -> PrVerbPhrase -> Str = \n,vp -> impVP : Number -> PrVerbPhrase -> Str = \n,vp ->
infVP UUnit UUnit 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 ; declCl : PrClause -> Str = \cl -> cl.subj ++ cl.v.p1 ++ cl.adV ++ cl.adv ++ cl.v.p2 ++ restCl cl ;
declSubordCl : PrClause -> Str = declCl ; declSubordCl : PrClause -> Str = declCl ;

View File

@@ -55,7 +55,7 @@ oper
Agr = ResEng.Agr ; Agr = ResEng.Agr ;
Case = ResEng.Case ; Case = ResEng.Case ;
NPCase = ResEng.NPCase ; NPCase = ResEng.NPCase ;
VForm = ResEng.VForm ; ---- VVForm to get contracted aux verbs VForm = ResEng.VVForm ; ---- VVForm to get contracted aux verbs
VVType = ResEng.VVType ; VVType = ResEng.VVType ;
SVoice = Voice ; SVoice = Voice ;
@@ -138,8 +138,8 @@ oper
VAPl => AgP3Pl VAPl => AgP3Pl
} ; } ;
vPastPart : PrVerb -> AAgr -> Str = \v,_ -> v.s ! VPPart ; vPastPart : PrVerb -> AAgr -> Str = \v,_ -> v.s ! VVF VPPart ;
vPresPart : PrVerb -> AAgr -> Str = \v,_ -> v.s ! VPresPart ; vPresPart : PrVerb -> AAgr -> Str = \v,_ -> v.s ! VVF VPresPart ;
vvInfinitive : VVType = VVInf ; vvInfinitive : VVType = VVInf ;
@@ -205,7 +205,7 @@ oper
-} ; -} ;
tenseActV : Str -> STense -> Anteriority -> Polarity -> VAgr -> PrVerb -> Str * Str * Str = \sta,t,a,p,agr,v -> 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 ; <Pres,VASgP3> => VPres ;
<Past|Cond,_ > => VPast ; <Past|Cond,_ > => VPast ;
_ => VInf _ => VInf
@@ -215,55 +215,58 @@ oper
<Pres|Past, Simul> => <Pres|Past, Simul> =>
case v.vtype of { case v.vtype of {
VTAux => case t of { VTAux => case t of {
Pres => <sta ++ v.s ! VPres, [], []> ; -- can I/she/we Pres => <sta ++ v.s ! VVF VPres, not_Str p, []> ; -- can I/she/we
_ => <sta ++ v.s ! vt, [], []> -- could ... _ => <sta ++ v.s ! VVF vt, not_Str p, []> -- could ...
} ; } ;
_ => case p of { _ => case p of {
Pos => <[], sta ++ v.s ! vt, []> ; -- this is the deviating case Pos => <[], sta ++ v.s ! VVF vt, []> ; -- this is the deviating case
Neg => <do_Aux vt Pos, not_Str p, sta ++ v.s ! VInf> 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> ; <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 ! VInf> ; <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 ! VPPart> <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 -> tenseActVContracted : 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 * VVForm = case <t,agr> of {
<Pres,VASgP3> => VPres ; <Pres,VASgP3> => <VPres, VVPresNeg> ;
<Past|Cond,_ > => VPast ; <Past|Cond,_ > => <VPast, VVPastNeg> ;
_ => VInf _ => <VInf, VVF VInf>
} ; } ;
in in
case <t,a> of { case <t,a> of {
<Pres|Past, Simul> => <Pres|Past, Simul> =>
case v.vtype of { case v.vtype of {
VTAux => <sta ++ v.s ! vt, [], []> ; VTAux => case p of {
Pos => <sta ++ v.s ! VVF vt.p1, [], []> ;
Neg => <sta ++ v.s ! vt.p2, [], []>
} ;
_ => case p of { _ => case p of {
Pos => <[], sta ++ v.s ! vt, []> ; -- this is the deviating case Pos => <[], sta ++ v.s ! VVF vt.p1, []> ; -- this is the deviating case
Neg => <do_Aux vt p, [], sta ++ v.s ! VInf> Neg => <do_Aux vt.p1 p, [], sta ++ v.s ! VVF VInf>
} }
} ; } ;
<Pres|Past, Anter> => <have_AuxC vt p, [], sta ++ v.s ! VPPart> <Pres|Past, Anter> => <have_AuxC vt.p1 p, [], sta ++ v.s ! VVF VPPart>
| <have_AuxC vt Pos, not_Str p, sta ++ v.s ! VPPart> ; | <have_AuxC vt.p1 Pos, not_Str p, sta ++ v.s ! VVF VPPart> ;
<Fut|Cond, Simul> => <will_AuxC vt p, [], sta ++ v.s ! VInf> <Fut|Cond, Simul> => <will_AuxC vt.p1 p, [], sta ++ v.s ! VVF VInf>
| <will_AuxC vt Pos, not_Str p, sta ++ v.s ! VInf> ; | <will_AuxC vt.p1 Pos, not_Str p, sta ++ v.s ! VVF VInf> ;
<Fut|Cond, Anter> => <will_AuxC vt p, have_Aux VInf Pos, sta ++ v.s ! VPPart> <Fut|Cond, Anter> => <will_AuxC vt.p1 p, have_Aux VInf Pos, sta ++ v.s ! VVF VPPart>
| <will_AuxC vt Pos, not_Str p ++ have_Aux VInf Pos, sta ++ v.s ! 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 -> tensePassV : Str -> STense -> Anteriority -> Polarity -> VAgr -> PrVerb -> Str * Str * Str = \sta,t,a,p,agr,v ->
let let
be = be_AuxL sta t a p agr ; be = be_AuxL sta t a p agr ;
done = v.s ! VPPart done = v.s ! VVF VPPart
in in
<be.p1, be.p2, be.p3 ++ done> ; <be.p1, be.p2, be.p3 ++ done> ;
tensePassVContracted : Str -> STense -> Anteriority -> Polarity -> VAgr -> PrVerb -> Str * Str * Str = \sta,t,a,p,agr,v -> tensePassVContracted : Str -> STense -> Anteriority -> Polarity -> VAgr -> PrVerb -> Str * Str * Str = \sta,t,a,p,agr,v ->
let let
be = be_AuxC sta t a p agr ; be = be_AuxC sta t a p agr ;
done = v.s ! VPPart done = v.s ! VVF VPPart
in in
<be.p1, be.p2, be.p3 ++ done> ; <be.p1, be.p2, be.p3 ++ done> ;
@@ -274,25 +277,25 @@ oper
case vt of { case vt of {
VVInf => VVInf =>
case a of { case a of {
Simul => not ++ "to" ++ sa ++ v.s ! VInf ; -- (she wants) (not) to sleep Simul => not ++ "to" ++ sa ++ v.s ! VVF VInf ; -- (she wants) (not) to sleep
Anter => not ++ "to" ++ have_Aux VInf Pos ++ sa ++ v.s ! VPPart -- (she wants) (not) to have slept Anter => not ++ "to" ++ have_Aux VInf Pos ++ sa ++ v.s ! VVF VPPart -- (she wants) (not) to have slept
} ; } ;
VVAux => VVAux =>
case a of { case a of {
Simul => not ++ sa ++ v.s ! VInf ; -- (she must) (not) sleep Simul => not ++ sa ++ v.s ! VVF VInf ; -- (she must) (not) sleep
Anter => not ++ have_Aux VInf Pos ++ sa ++ v.s ! VPPart -- (she must) (not) have slept Anter => not ++ have_Aux VInf Pos ++ sa ++ v.s ! VVF VPPart -- (she must) (not) have slept
} ; } ;
VVPresPart => VVPresPart =>
case a of { case a of {
Simul => not ++ sa ++ v.s ! VPresPart ; -- (she starts) (not) sleeping Simul => not ++ sa ++ v.s ! VVF VPresPart ; -- (she starts) (not) sleeping
Anter => not ++ "having" ++ sa ++ v.s ! VPPart -- (she starts) (not) having slept Anter => not ++ "having" ++ sa ++ v.s ! VVF VPPart -- (she starts) (not) having slept
} }
} ; } ;
imperativeV : Str -> Polarity -> ImpType -> PrVerb -> Str = \s,p,it,v -> imperativeV : Str -> Polarity -> ImpType -> PrVerb -> Str = \s,p,it,v ->
s ++ case p of { s ++ case p of {
Pos => v.s ! VInf ; Pos => v.s ! VVF VInf ;
Neg => ("do not" | "don't") ++ v.s ! VInf Neg => ("do not" | "don't") ++ v.s ! VVF VInf
} ; } ;
@@ -373,11 +376,13 @@ oper
oper oper
be_V : PrVerb = { be_V : PrVerb = {
s = table { s = table {
VInf => "be" ; VVF VInf => "be" ;
VPres => "is" ; VVF VPres => "is" ;
VPast => "was" ; VVF VPast => "was" ;
VPPart => "been" ; VVF VPPart => "been" ;
VPresPart => "being" VVF VPresPart => "being" ;
VVPresNeg => "isn't" ;
VVPastNeg => "wasn't"
} ; } ;
p,c1,c2 = [] ; vtype = VTAux ; vvtype = VVInf ; isSubjectControl = False p,c1,c2 = [] ; vtype = VTAux ; vvtype = VVInf ; isSubjectControl = False
} ; } ;
@@ -389,20 +394,20 @@ oper
oper oper
---- have to split the tables to two to get reasonable PMCFG generation ---- 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, Pos> => varAux "will" "ll" ;
<VInf|VPres, Neg> => "won't" ; <VInf|VPres, Neg> => "won't" ;
<VPast|_ , Pos> => varAux "would" "d" ; <VPast|_ , Pos> => varAux "would" "d" ;
<VPast|_ , Neg> => "wouldn't" <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, Pos> => varAuxC "will" "ll" ;
<VInf|VPres, Neg> => "won't" ; <VInf|VPres, Neg> => "won't" ;
<VPast|_ , Pos> => varAuxC "would" "d" ; <VPast|_ , Pos> => varAuxC "would" "d" ;
<VPast|_ , Neg> => "wouldn't" <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, Pos> => varAux "have" "ve" ; --- slightly overgenerating if used in infinitive
<VInf, Neg> => "haven't" ; <VInf, Neg> => "haven't" ;
<VPres, Pos> => varAux "has" "s" ; <VPres, Pos> => varAux "has" "s" ;
@@ -410,7 +415,7 @@ oper
<VPast|_ , Pos> => varAux "had" "d" ; <VPast|_ , Pos> => varAux "had" "d" ;
<VPast|_ , Neg> => "hadn't" <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, Pos> => varAuxC "have" "ve" ; --- slightly overgenerating if used in infinitive
<VInf, Neg> => "haven't" ; <VInf, Neg> => "haven't" ;
<VPres, Pos> => varAuxC "has" "s" ; <VPres, Pos> => varAuxC "has" "s" ;
@@ -419,7 +424,7 @@ oper
<VPast|_ , Neg> => "hadn't" <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, Pos> => "do" ;
<VInf, Neg> => "don't" ; <VInf, Neg> => "don't" ;
<VPres, Pos> => "does" ; <VPres, Pos> => "does" ;

View File

@@ -3,6 +3,7 @@ instance PredInstanceFin of
NounPhrase, NounPhrase,
PrVerb, initPrVerb, PrVerb, initPrVerb,
PrVerbPhrase, initPrVerbPhrase, initPrVerbPhraseV, useCopula, linrefPrVP, qformsVP, applyVerb, addObj2VP, PrVerbPhrase, initPrVerbPhrase, initPrVerbPhraseV, useCopula, linrefPrVP, qformsVP, applyVerb, addObj2VP,
initBasePrVerbPhrase, initBasePrVerbPhraseV,
PrClause, initPrClause PrClause, initPrClause
] = ] =
open ResFin, (P = ParadigmsFin), (S = StemFin), (X = ParamX), Prelude in { open ResFin, (P = ParadigmsFin), (S = StemFin), (X = ParamX), Prelude in {