mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-01 15:22:50 -06:00
started TransSwe with the new Predication
This commit is contained in:
@@ -248,6 +248,37 @@ lin
|
||||
qforms = \\agr => qformsV (a.s ++ t.s ++ p.s) t.t a.a p.p agr v ;
|
||||
} ;
|
||||
|
||||
|
||||
PassUseV a t p _ v = {
|
||||
v = \\agr => tenseV (a.s ++ t.s ++ p.s) t.t a.a p.p Pass agr v ;
|
||||
inf = tenseInfV a.s a.a p.p Pass v ;
|
||||
c1 = v.c1 ;
|
||||
c2 = v.c2 ;
|
||||
part = v.p ;
|
||||
adj = noObj ;
|
||||
obj1 = <noObj, defaultAgr> ; ---- not used, just default value
|
||||
obj2 = <noObj, True> ; -- becomes subject control even if object control otherwise "*she was promised by us to love ourselves"
|
||||
adV = negAdV p ;
|
||||
adv = [] ;
|
||||
ext = [] ;
|
||||
qforms = \\agr => qformsBe (a.s ++ t.s ++ p.s) t.t a.a p.p agr ;
|
||||
} ;
|
||||
|
||||
AgentPassUseV a t p _ v np = {
|
||||
v = \\agr => tenseV (a.s ++ t.s ++ p.s) t.t a.a p.p Pass agr v ;
|
||||
inf = tenseInfV a.s a.a p.p Pass v ;
|
||||
c1 = v.c1 ;
|
||||
c2 = v.c2 ;
|
||||
part = v.p ;
|
||||
adj = \\a => [] ;
|
||||
obj1 = <noObj, defaultAgr> ;
|
||||
obj2 = <noObj, True> ;
|
||||
adV = negAdV p ;
|
||||
adv = appComplCase agentCase np ;
|
||||
ext = [] ;
|
||||
qforms = \\agr => qformsBe (a.s ++ t.s ++ p.s) t.t a.a p.p agr ;
|
||||
} ;
|
||||
|
||||
UseAP a t p _ ap = {
|
||||
v = \\agr => be_Aux (a.s ++ t.s ++ p.s) t.t a.a p.p agr ;
|
||||
inf = tenseInfV a.s a.a p.p Act be_V ;
|
||||
@@ -267,6 +298,36 @@ lin
|
||||
obj1 : (Agr => Str) * Agr = <\\a => np.s ! objCase, np.a> -- np.a for object control
|
||||
} ;
|
||||
|
||||
SlashV3 x vp np = addObj2VP vp (\\a => np.s ! objCase) ; -- control is preserved
|
||||
|
||||
ComplVS x vp cl = addExtVP vp (that_Compl ++ declSubordCl (lin Cl cl)) ; ---- sentence form
|
||||
|
||||
ComplVQ x vp qcl = addExtVP vp (questSubordCl qcl) ; ---- question form
|
||||
|
||||
ComplVV x vp vpo = addObj2VP vp (\\a => infVP a vpo) ; ---- infForm
|
||||
|
||||
ComplVA x vp ap = addObj2VP vp (\\a => ap.s ! agr2aagr a ++ ap.obj1 ! a) ; ---- adjForm
|
||||
|
||||
ComplVN x vp cn = addObj2VP vp (\\a => cn.s ! agr2nagr a ++ cn.obj1 ! a) ; ---- cnForm
|
||||
|
||||
SlashV2S x vp cl = addExtVP vp (that_Compl ++ declSubordCl (lin Cl cl)) ; ---- sentence form
|
||||
|
||||
SlashV2Q x vp cl = addExtVP vp (questSubordCl (lin QCl cl)) ; ---- question form
|
||||
|
||||
SlashV2V x vp vpo = addObj2VP vp (\\a => infVP a (lin VP vpo)) ; ---- infForm
|
||||
|
||||
SlashV2A x vp ap = addObj2VP vp (\\a => ap.s ! agr2aagr a ++ ap.obj1 ! a) ; ---- adjForm
|
||||
|
||||
SlashV2N x vp cn = addObj2VP vp (\\a => cn.s ! agr2nagr a ++ cn.obj1 ! a) ; ---- cn form
|
||||
|
||||
ReflVP x vp = vp ** {
|
||||
obj1 : (Agr => Str) * Agr = <\\a => reflPron ! a, defaultAgr> ; --- defaultAgr will not be used but subj.a instead
|
||||
} ;
|
||||
|
||||
ReflVP2 x vp = vp ** {
|
||||
obj2 : (Agr => Str) * Bool = <\\a => reflPron ! a, vp.obj2.p2> ; --- subj/obj control doesn't matter any more
|
||||
} ;
|
||||
|
||||
PredVP x np vp = vp ** {
|
||||
v = vp.v ! agr2vagr np.a ;
|
||||
subj = np.s ! subjCase ;
|
||||
@@ -277,6 +338,60 @@ lin
|
||||
qforms = vp.qforms ! agr2vagr np.a ;
|
||||
} ;
|
||||
|
||||
PrepCl p x cl = cl ** { -- Cl/NP ::= Cl PP/NP
|
||||
c3 = prepComplCase p ;
|
||||
} ;
|
||||
|
||||
SlashClNP x cl np = cl ** { -- Cl ::= Cl/NP NP
|
||||
adv = cl.adv ++ appComplCase cl.c3 np ; ---- again, adv just added
|
||||
c3 = noComplCase ; -- complCase has been consumed
|
||||
} ;
|
||||
|
||||
|
||||
-- QCl ::= Cl by just adding focus field
|
||||
QuestCl x cl = cl ** {foc = [] ; focType = NoFoc} ; -- NoFoc implies verb first: does she love us
|
||||
|
||||
QuestIAdv x iadv cl = cl ** {foc = iadv.s ; focType = FocObj} ; -- FocObj implies Foc + V + Subj: why does she love us
|
||||
|
||||
QuestVP x ip vp = let ipa = ipagr2agr ip.n in
|
||||
vp ** {
|
||||
v = vp.v ! ipagr2vagr ip.n ;
|
||||
foc = ip.s ! subjCase ; -- who (loves her)
|
||||
focType = FocSubj ;
|
||||
subj = [] ;
|
||||
adj = vp.adj ! ipa ;
|
||||
obj1 = vp.part ++ vp.c1 ++ vp.obj1.p1 ! ipa ; ---- appComplCase
|
||||
obj2 = vp.c2 ++ vp.obj2.p1 ! (case vp.obj2.p2 of {True => ipa ; False => vp.obj1.p2}) ; ---- appComplCase
|
||||
c3 = noComplCase ; -- for one more prep to build ClSlash ---- ever needed for QCl?
|
||||
qforms = vp.qforms ! ipagr2vagr ip.n ;
|
||||
} ;
|
||||
|
||||
QuestSlash x ip cl =
|
||||
let
|
||||
prep = cl.c3 ;
|
||||
ips = ip.s ! objCase ; -- in Cl/NP, c3 is the only prep ---- appComplCase for ip
|
||||
focobj = case cl.focType of {
|
||||
NoFoc => <ips, [], FocObj,prep> ; -- put ip object to focus if there is no focus yet
|
||||
t => <[], prep ++ ips, t,noComplCase> -- put ip object in situ if there already is a focus
|
||||
} ;
|
||||
in
|
||||
cl ** { -- preposition stranding
|
||||
foc = focobj.p1 ;
|
||||
focType = focobj.p3 ;
|
||||
obj1 = cl.obj1 ++ focobj.p2 ; ---- just add to a field?
|
||||
c3 = focobj.p4 ;
|
||||
} ;
|
||||
{-
|
||||
---- this is giving four records instead of two AR 5/2/2014
|
||||
|
|
||||
cl ** { -- pied piping
|
||||
foc = focobj.p4 ++ focobj.p1 ;
|
||||
focType = focobj.p3 ;
|
||||
obj1 = cl.obj1 ++ focobj.p2 ; ---- just add to a field?
|
||||
c3 = noComplCase ;
|
||||
} ;
|
||||
-}
|
||||
|
||||
UseCl cl = {s = declCl cl} ;
|
||||
UseQCl cl = {s = questCl cl} ;
|
||||
|
||||
@@ -285,6 +400,91 @@ lin
|
||||
UttS s = s ;
|
||||
|
||||
|
||||
AdvCl x a cl = case a.isAdV of {
|
||||
True => cl ** {adV = cl.adV ++ a.s ; adv = cl.adv ; c3 = a.c1} ;
|
||||
False => cl ** {adv = cl.adv ++ a.s ; adV = cl.adV ; c3 = a.c1}
|
||||
} ;
|
||||
|
||||
AdvQCl x a cl = case a.isAdV of {
|
||||
True => cl ** {adV = cl.adV ++ a.s ; adv = cl.adv ; c3 = a.c1} ;
|
||||
False => cl ** {adv = cl.adv ++ a.s ; adV = cl.adV ; c3 = a.c1}
|
||||
} ;
|
||||
|
||||
|
||||
PresPartAP x v = {
|
||||
s = \\a => v.v ! vPresPart a ;
|
||||
c1 = v.c1 ; -- looking at her
|
||||
c2 = v.c2 ;
|
||||
obj1 = noObj ;
|
||||
} ;
|
||||
|
||||
PastPartAP x v = {
|
||||
s = \\a => v.v ! vPastPart a ;
|
||||
c1 = v.c1 ;
|
||||
c2 = v.c2 ;
|
||||
obj1 = noObj ;
|
||||
} ;
|
||||
|
||||
AgentPastPartAP x v np = {
|
||||
s = \\a => v.v ! vPastPart a ;
|
||||
c1 = v.c1 ;
|
||||
c2 = v.c2 ;
|
||||
obj1 = \\_ => appComplCase agentCase np ; ---- addObj
|
||||
} ;
|
||||
|
||||
|
||||
StartVPC c x v w = { ---- some loss of quality seems inevitable
|
||||
v = \\a =>
|
||||
let
|
||||
vv = v.v ! a ;
|
||||
wv = w.v ! a ;
|
||||
vpa = vagr2agr a ;
|
||||
in
|
||||
vv.p1 ++ v.adV ++ vv.p2 ++ vv.p3 ++ v.adj ! vpa ++
|
||||
v.c1 ++ v.obj1.p1 ! vpa ++ v.c2 ++ v.obj2.p1 ! vpa ++ v.adv ++ v.ext ---- appComplCase
|
||||
++ c.s2 ++
|
||||
wv.p1 ++ w.adV ++ wv.p2 ++ wv.p3 ++ w.adj ! vpa ++ ---- appComplCase
|
||||
w.c1 ++ w.obj1.p1 ! vpa ++ w.c2 ++ w.obj2.p1 ! vpa ++ w.adv ++ w.ext ;
|
||||
inf = \\a =>
|
||||
PredEng.infVP a v ++ c.s2 ++ PredEng.infVP a w ;
|
||||
c1 = [] ; ---- w.c1 ? --- the full story is to unify v and w...
|
||||
c2 = [] ; ---- w.c2 ?
|
||||
} ;
|
||||
|
||||
UseVPC x vpc = { ---- big loss of quality (overgeneration) seems inevitable
|
||||
v = \\a => <[], [], vpc.v ! a> ;
|
||||
inf = <[], vpc.inf ! defaultAgr> ; ---- agreement
|
||||
c1 = vpc.c1 ;
|
||||
c2 = vpc.c2 ;
|
||||
part = [] ;
|
||||
adj = \\a => [] ;
|
||||
obj1 = <noObj, defaultAgr> ;
|
||||
obj2 = <noObj,True> ;
|
||||
adv,adV = [] ;
|
||||
ext = [] ;
|
||||
qforms = \\a => <"do", vpc.inf ! defaultAgr> ; ---- do/does/did
|
||||
} ;
|
||||
|
||||
StartClC c x a b = {
|
||||
s = declCl (lin Cl a) ++ c.s2 ++ declCl (lin Cl b) ;
|
||||
c3 = b.c3 ; ----
|
||||
} ;
|
||||
|
||||
UseClC x cl = {
|
||||
subj = [] ;
|
||||
v = <[],[],cl.s> ; ----
|
||||
inf = <[],[]> ;
|
||||
adj = [] ;
|
||||
obj1 = [] ;
|
||||
obj2 = [] ;
|
||||
adV = [] ;
|
||||
adv = [] ;
|
||||
ext = [] ;
|
||||
c3 = cl.c3 ;
|
||||
qforms = <[],[]> ; ---- qforms
|
||||
} ;
|
||||
|
||||
ComplAdv x p np = {s = p.c1 ++ np.s ! objCase ; isAdV = p.isAdV ; c1 = []} ;
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user