mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-14 15:29:31 -06:00
particle verbs in English: make discontinuous (at last). Accessed by ParadigmsEng.partV (as before, but without real effect) and ExtraEng.ComplSlashPartLast.
This commit is contained in:
@@ -80,7 +80,7 @@ concrete CatEng of Cat = CommonX - [Pol] ** open ResEng, Prelude in {
|
||||
V, VS, VQ, VA = Verb ; -- = {s : VForm => Str} ;
|
||||
V2, V2A, V2Q, V2S = Verb ** {c2 : Str} ;
|
||||
V3 = Verb ** {c2, c3 : Str} ;
|
||||
VV = {s : VVForm => Str ; typ : VVType} ;
|
||||
VV = {s : VVForm => Str ; p : Str ; typ : VVType} ;
|
||||
V2V = Verb ** {c2,c3 : Str ; typ : VVType} ;
|
||||
|
||||
A = {s : AForm => Str} ;
|
||||
|
||||
@@ -40,9 +40,9 @@ concrete ExtraEng of ExtraEngAbs = CatEng **
|
||||
|
||||
MkVPI vp = {
|
||||
s = table {
|
||||
VVAux => \\a => vp.ad ++ vp.inf ++ vp.s2 ! a;
|
||||
VVInf => \\a => "to" ++ vp.ad ++ vp.inf ++ vp.s2 ! a;
|
||||
VVPresPart => \\a => vp.ad ++ vp.prp ++ vp.s2 ! a
|
||||
VVAux => \\a => vp.ad ++ vp.inf ++ vp.p ++ vp.s2 ! a;
|
||||
VVInf => \\a => "to" ++ vp.ad ++ vp.inf ++ vp.p ++ vp.s2 ! a;
|
||||
VVPresPart => \\a => vp.ad ++ vp.prp ++ vp.p ++ vp.s2 ! a
|
||||
}
|
||||
} ;
|
||||
ConjVPI = conjunctDistrTable2 VVType Agr ;
|
||||
@@ -81,7 +81,7 @@ concrete ExtraEng of ExtraEngAbs = CatEng **
|
||||
let
|
||||
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.s2 ! a
|
||||
in t.s ++ p.s ++ vp.ad ++ verbf ++ vp.p ++ vp.s2 ! a
|
||||
} ;
|
||||
|
||||
ConjVPS = conjunctDistrTable Agr ;
|
||||
@@ -109,6 +109,7 @@ concrete ExtraEng of ExtraEngAbs = CatEng **
|
||||
VVPastNeg => ["didn't"] ; --# notpresent
|
||||
VVPresNeg => "doesn't"
|
||||
} ;
|
||||
p = [] ;
|
||||
typ = VVAux
|
||||
} ;
|
||||
|
||||
@@ -122,6 +123,7 @@ concrete ExtraEng of ExtraEngAbs = CatEng **
|
||||
VVPastNeg => "mightn't" ; --# notpresent
|
||||
VVPresNeg => "may not"
|
||||
} ;
|
||||
p = [] ;
|
||||
typ = VVAux
|
||||
} ;
|
||||
|
||||
@@ -135,6 +137,7 @@ concrete ExtraEng of ExtraEngAbs = CatEng **
|
||||
VVPastNeg => "shouldn't" ; --# notpresent
|
||||
VVPresNeg => "shall not" --- shan't
|
||||
} ;
|
||||
p = [] ;
|
||||
typ = VVAux
|
||||
} ;
|
||||
|
||||
@@ -153,6 +156,7 @@ lin
|
||||
ppt = vps.ptp
|
||||
in {
|
||||
s = be.s ;
|
||||
p = vps.p ;
|
||||
prp = be.prp ;
|
||||
ptp = be.ptp ;
|
||||
inf = be.inf ;
|
||||
@@ -160,6 +164,11 @@ lin
|
||||
s2 = \\a => ppt ++ vps.s2 ! a ---- order
|
||||
} ;
|
||||
|
||||
--- AR 7/3/2013
|
||||
ComplSlashPartLast vps np = case vps.gapInMiddle of {
|
||||
_ => insertObjPartLast (\\_ => vps.c2 ++ np.s ! NPAcc) vps ---
|
||||
} ;
|
||||
|
||||
------------
|
||||
--- obsolete: use UncNeg : Pol
|
||||
|
||||
|
||||
@@ -24,6 +24,10 @@ abstract ExtraEngAbs = Extra - [ProDrop] ** {
|
||||
may_VV : VV ;
|
||||
|
||||
shall_VV : VV ;
|
||||
|
||||
--- AR 7/3/2013
|
||||
ComplSlashPartLast : VPSlash -> NP -> VP ;
|
||||
|
||||
---------------------
|
||||
--- these are obsolete: use UncNeg : Pol instead
|
||||
|
||||
|
||||
@@ -531,24 +531,26 @@ mkSubj : Str -> Subj = \s -> lin Subj {s = s} ; --%
|
||||
in
|
||||
mk5V fit (fit + "s") y z fitting ;
|
||||
|
||||
partV v p = lin V {s = \\f => v.s ! f ++ p ; isRefl = v.isRefl} ;
|
||||
reflV v = lin V {s = v.s ; part = v.part ; isRefl = True} ;
|
||||
partV v p = lin V {s = \\f => v.s ! f ; p = p ; isRefl = v.isRefl} ;
|
||||
reflV v = lin V {s = v.s ; p = v.p ; isRefl = True} ;
|
||||
|
||||
prepV2 v p = lin V2 {s = v.s ; s1 = v.s1 ; c2 = p.s ; isRefl = v.isRefl} ;
|
||||
prepV2 v p = lin V2 {s = v.s ; p = v.p ; s1 = v.s1 ; c2 = p.s ; isRefl = v.isRefl} ;
|
||||
dirV2 v = prepV2 v noPrep ;
|
||||
|
||||
prepPrepV3 v p q =
|
||||
lin V3 {s = v.s ; s1 = v.s1 ; c2 = p.s ; c3 = q.s ; isRefl = v.isRefl} ;
|
||||
lin V3 {s = v.s ; p = v.p ; s1 = v.s1 ; c2 = p.s ; c3 = q.s ; isRefl = v.isRefl} ;
|
||||
dirV3 v p = prepPrepV3 v noPrep p ;
|
||||
dirdirV3 v = dirV3 v noPrep ;
|
||||
|
||||
mkVS v = lin VS v ;
|
||||
mkVV v = lin VV {
|
||||
s = table {VVF vf => v.s ! vf ; _ => v.s ! VInf} ;
|
||||
p = v.p ;
|
||||
typ = VVInf
|
||||
} ;
|
||||
ingVV v = lin VV {
|
||||
s = table {VVF vf => v.s ! vf ; _ => v.s ! VInf} ;
|
||||
p = v.p ;
|
||||
typ = VVPresPart
|
||||
} ;
|
||||
mkVQ v = lin VQ v ;
|
||||
@@ -646,7 +648,7 @@ mkSubj : Str -> Subj = \s -> lin Subj {s = s} ; --%
|
||||
|
||||
prepV2 : V -> Prep -> V2 ;
|
||||
dirV2 : V -> V2 ;
|
||||
prefixV : Str -> V -> V = \p,v -> lin V { s = \\vform => p + v.s ! vform; isRefl = v.isRefl } ;
|
||||
prefixV : Str -> V -> V = \p,v -> lin V { s = \\vform => p + v.s ! vform; p = v.p ; isRefl = v.isRefl } ;
|
||||
|
||||
mkV2 = overload {
|
||||
mkV2 : V -> V2 = dirV2 ;
|
||||
|
||||
@@ -154,6 +154,7 @@ resource ResEng = ParamX ** open Prelude in {
|
||||
VPPart => gone ;
|
||||
VPresPart => going
|
||||
} ;
|
||||
p = [] ; -- no particle
|
||||
isRefl = False
|
||||
} ;
|
||||
|
||||
@@ -203,6 +204,7 @@ resource ResEng = ParamX ** open Prelude in {
|
||||
|
||||
Verb : Type = {
|
||||
s : VForm => Str ;
|
||||
p : Str ; -- verb particle
|
||||
isRefl : Bool
|
||||
} ;
|
||||
|
||||
@@ -223,6 +225,7 @@ resource ResEng = ParamX ** open Prelude in {
|
||||
|
||||
VP : Type = {
|
||||
s : VerbForms ;
|
||||
p : Str ; -- verb particle
|
||||
prp : Str ; -- present participle
|
||||
ptp : Str ; -- past participle
|
||||
inf : Str ; -- the infinitive form ; VerbForms would be the logical place
|
||||
@@ -263,6 +266,7 @@ resource ResEng = ParamX ** open Prelude in {
|
||||
<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 ;
|
||||
ptp = verb.s ! VPPart ;
|
||||
inf = verb.s ! VInf ;
|
||||
@@ -300,6 +304,7 @@ resource ResEng = ParamX ** open Prelude in {
|
||||
<Pres,Simul,CPos, _> => vf fin [] ;
|
||||
<Pres,Simul,CNeg c, _> => vfn c finp fin []
|
||||
} ;
|
||||
p = [] ;
|
||||
prp = verb.prpart ;
|
||||
ptp = verb.ppart ;
|
||||
inf = verb.inf ;
|
||||
@@ -321,6 +326,7 @@ resource ResEng = ParamX ** open Prelude in {
|
||||
|
||||
insertObj : (Agr => Str) -> VP -> VP = \obj,vp -> {
|
||||
s = vp.s ;
|
||||
p = vp.p ;
|
||||
prp = vp.prp ;
|
||||
ptp = vp.ptp ;
|
||||
inf = vp.inf ;
|
||||
@@ -330,6 +336,7 @@ resource ResEng = ParamX ** open Prelude in {
|
||||
|
||||
insertObjPre : (Agr => Str) -> VP -> VP = \obj,vp -> {
|
||||
s = vp.s ;
|
||||
p = vp.p ;
|
||||
prp = vp.prp ;
|
||||
ptp = vp.ptp ;
|
||||
inf = vp.inf ;
|
||||
@@ -340,10 +347,22 @@ resource ResEng = ParamX ** open Prelude in {
|
||||
insertObjc : (Agr => Str) -> SlashVP -> SlashVP = \obj,vp ->
|
||||
insertObj obj vp ** {c2 = vp.c2 ; gapInMiddle = vp.gapInMiddle} ;
|
||||
|
||||
--- AR 7/3/2013 move the particle after the object
|
||||
insertObjPartLast : (Agr => Str) -> VP -> VP = \obj,vp -> {
|
||||
s = vp.s ;
|
||||
p = [] ; -- remove particle from here
|
||||
prp = vp.prp ;
|
||||
ptp = vp.ptp ;
|
||||
inf = vp.inf ;
|
||||
ad = vp.ad ;
|
||||
s2 = \\a => obj ! a ++ vp.s2 ! a ++ vp.p -- and put it here ; corresponds to insertObjPre
|
||||
} ;
|
||||
|
||||
--- The adverb should be before the finite verb.
|
||||
|
||||
insertAdV : Str -> VP -> VP = \ad,vp -> {
|
||||
s = vp.s ;
|
||||
p = vp.p ;
|
||||
prp = vp.prp ;
|
||||
ptp = vp.ptp ;
|
||||
inf = vp.inf ;
|
||||
@@ -353,7 +372,7 @@ resource ResEng = ParamX ** open Prelude in {
|
||||
|
||||
--
|
||||
|
||||
predVV : {s : VVForm => Str ; typ : VVType} -> VP = \verb ->
|
||||
predVV : {s : VVForm => Str ; p : Str ; typ : VVType} -> VP = \verb ->
|
||||
let verbs = verb.s
|
||||
in
|
||||
case verb.typ of {
|
||||
@@ -366,11 +385,12 @@ resource ResEng = ParamX ** open Prelude in {
|
||||
Pos => \\_ => verbs ! VVF VPast ; --# notpresent
|
||||
Neg => \\_ => verbs ! VVPastNeg --# notpresent
|
||||
} ; --# notpresent
|
||||
p = verb.p ;
|
||||
inf = verbs ! VVF VInf ;
|
||||
ppart = verbs ! VVF VPPart ;
|
||||
prpart = verbs ! VVF VPresPart ;
|
||||
} ;
|
||||
_ => predV {s = \\vf => verbs ! VVF vf ; isRefl = False}
|
||||
_ => predV {s = \\vf => verbs ! VVF vf ; p = verb.p ; isRefl = False}
|
||||
} ;
|
||||
|
||||
presVerb : {s : VForm => Str} -> Agr -> Str = \verb ->
|
||||
@@ -383,13 +403,13 @@ resource ResEng = ParamX ** open Prelude in {
|
||||
VVAux => vp.ad ++ vp.inf ;
|
||||
VVInf => "to" ++ vp.ad ++ vp.inf ;
|
||||
_ => vp.ad ++ vp.prp
|
||||
};
|
||||
Anter => case typ of {
|
||||
VVAux => "have" ++ vp.ad ++ vp.ptp ;
|
||||
VVInf => "to" ++ "have" ++ vp.ad ++ vp.ptp ;
|
||||
_ => "having" ++ vp.ad ++ vp.ptp
|
||||
}
|
||||
} ++
|
||||
; Anter => case typ of { --# notpresent
|
||||
VVAux => "have" ++ vp.ad ++ vp.ptp ; --# notpresent
|
||||
VVInf => "to" ++ "have" ++ vp.ad ++ vp.ptp ; --# notpresent
|
||||
_ => "having" ++ vp.ad ++ vp.ptp --# notpresent
|
||||
} --# notpresent
|
||||
} ++ vp.p ++
|
||||
vp.s2 ! a ;
|
||||
|
||||
agrVerb : Str -> Str -> Agr -> Str = \has,have,agr ->
|
||||
@@ -456,8 +476,8 @@ resource ResEng = ParamX ** open Prelude in {
|
||||
compl = vp.s2 ! agr
|
||||
in
|
||||
case o of {
|
||||
ODir => subj ++ verb.aux ++ verb.adv ++ vp.ad ++ verb.fin ++ verb.inf ++ compl ;
|
||||
OQuest => verb.aux ++ subj ++ verb.adv ++ vp.ad ++ verb.fin ++ verb.inf ++ 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
|
||||
}
|
||||
} ;
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ concrete StructuralEng of Structural = CatEng **
|
||||
VVPastNeg => "couldn't" ; --# notpresent
|
||||
VVPresNeg => "can't"
|
||||
} ;
|
||||
p = [] ;
|
||||
typ = VVAux
|
||||
} ;
|
||||
during_Prep = mkPrep "during" ;
|
||||
@@ -70,6 +71,7 @@ concrete StructuralEng of Structural = CatEng **
|
||||
VVPastNeg => ["hadn't to"] ; --# notpresent
|
||||
VVPresNeg => "mustn't"
|
||||
} ;
|
||||
p = [] ;
|
||||
typ = VVAux
|
||||
} ;
|
||||
---b no_Phr = ss "no" ;
|
||||
|
||||
Reference in New Issue
Block a user