mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-06-23 18:21:11 -06:00
(Ger) Small fix to get 'present' installed
new SlashVP, RelSlash in tests/german/TestLangGer.gf to control reflexives in relative clauses
This commit is contained in:
@@ -12,16 +12,9 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
|
||||
MkVPI vp = {s = \\b => useInfVP b vp} ;
|
||||
ConjVPI = conjunctDistrTable Bool ;
|
||||
|
||||
ComplVPIVV v vpi =
|
||||
-- insertInf (vpi.s ! v.isAux) (
|
||||
insertInf {s=(vpi.s ! v.isAux);isAux=v.isAux;ctrl=SubjC} ( -- HL ??
|
||||
predVGen v.isAux v) ; ----
|
||||
{-
|
||||
insertExtrapos vpi.p3 (
|
||||
insertInf vpi.p2 (
|
||||
insertObj vpi.p1 (
|
||||
predVGen v.isAux v))) ;
|
||||
-}
|
||||
ComplVPIVV v vpi =
|
||||
insertInf {inpl = <\\_ => [], (vpi.s ! v.isAux)> ; extr = \\_ => []} -- HL 3/22
|
||||
(predVGen v.isAux v) ;
|
||||
|
||||
PPzuAdv cn = {s = case cn.g of {
|
||||
Masc | Neutr => "zum" ;
|
||||
@@ -33,8 +26,8 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
|
||||
|
||||
moegen_VV = auxVV mögen_V ;
|
||||
|
||||
ICompAP ap = {s = \\_ => "wie" ++ ap.s ! APred ;
|
||||
ext = ap.c.p1 ++ ap.c.p2 ++ ap.ext} ;
|
||||
ICompAP ap = {s = \\_ => "wie" ++ ap.s ! APred ;
|
||||
ext = ap.c.p1 ++ ap.c.p2 ++ ap.ext} ;
|
||||
|
||||
CompIQuant iq = {s = table {Ag g n p => iq.s ! n ! g ! Nom} ; ext = ""} ;
|
||||
|
||||
@@ -43,8 +36,6 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
|
||||
DetNPMasc det = {
|
||||
s = \\c => det.sp ! Masc ! c ; ---- genders
|
||||
a = agrP3 det.n ;
|
||||
-- isPron = False ;
|
||||
-- isLight = True ;
|
||||
w = WLight ;
|
||||
ext, rc = []
|
||||
} ;
|
||||
@@ -52,8 +43,6 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
|
||||
DetNPFem det = {
|
||||
s = \\c => det.sp ! Fem ! c ; ---- genders
|
||||
a = agrP3 det.n ;
|
||||
-- isPron = False ;
|
||||
-- isLight = True ;
|
||||
w = WLight ;
|
||||
ext, rc = []
|
||||
} ;
|
||||
@@ -66,37 +55,40 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
|
||||
} ;
|
||||
|
||||
PassVPSlash vp =
|
||||
let c = case <vp.c2.c,vp.c2.isPrep> of {
|
||||
<NPC Acc,False> => NPC Nom ;
|
||||
_ => vp.c2.c}
|
||||
in insertObj (\\_ => (PastPartAP vp).s ! APred) (predV werdenPass) **
|
||||
{subjc = vp.c2 ** {c= c}} ;
|
||||
-- regulates passivised object: accusative objects -> nom; all others: same case
|
||||
-- this also gives "mit dir wird gerechnet" ;
|
||||
-- the alternative linearisation ("es wird mit dir gerechnet") is not implemented
|
||||
let c = case <vp.c2.c,vp.c2.isPrep> of {
|
||||
<NPC Acc,False> => NPC Nom ;
|
||||
_ => vp.c2.c}
|
||||
in insertObj (\\_ => (PastPartAP vp).s ! APred) (predV werdenPass) **
|
||||
{ c1 = vp.c2 ** {c = c}} ;
|
||||
-- regulates passivised object: accusative objects -> nom; all others: same case
|
||||
-- this also gives "mit dir wird gerechnet" ;
|
||||
-- the alternative linearisation ("es wird mit dir gerechnet") is not implemented
|
||||
|
||||
PassAgentVPSlash vp np = ---- "von" here, "durch" in StructuralGer
|
||||
insertObj (\\_ => (PastPartAgentAP (lin VPSlash vp) (lin NP np)).s ! APred) (predV werdenPass) ;
|
||||
|
||||
Pass3V3 v = -- HL 7/19
|
||||
let bekommenPass : Verb = P.habenV (P.irregV "bekommen" "bekommt" "bekam" "bekäme" "bekommen")
|
||||
in insertObj (\\_ => (v.s ! VPastPart APred)) (predV bekommenPass) ** { subjc = PrepNom ; c2 = v.c2 } ;
|
||||
in insertObj (\\_ => (v.s ! VPastPart APred)) (predV bekommenPass) **
|
||||
{ c1 = PrepNom ; c2 = v.c2 ; objCtrl = False } ;
|
||||
|
||||
PastPartAP vp = {
|
||||
s = \\af => (vp.nn ! agrP3 Sg).p1 ++ (vp.nn ! agrP3 Sg).p2 ++ (vp.nn ! agrP3 Sg).p3 ++ vp.a2 ++ vp.inf.s ++
|
||||
vp.ext ++ vp.infExt ++ vp.s.s ! VPastPart af ;
|
||||
isPre = True ;
|
||||
c = <[],[]> ;
|
||||
ext = []
|
||||
PastPartAP vp =
|
||||
let a = agrP3 Sg in {
|
||||
s = \\af => (vp.nn ! a).p1 ++ (vp.nn ! a).p2 ++ (vp.nn ! a).p3 ++ vp.a2
|
||||
++ vp.inf.inpl.p2 ++ (vp.inf.extr ! a) ++ vp.s.s ! VPastPart af ;
|
||||
isPre = True ;
|
||||
c = <[],[]> ;
|
||||
ext = vp.ext
|
||||
} ;
|
||||
|
||||
PastPartAgentAP vp np =
|
||||
let agent = appPrepNP P.von_Prep np
|
||||
in {
|
||||
s = \\af => (vp.nn ! agrP3 Sg).p1 ++ (vp.nn ! agrP3 Sg).p2 ++ (vp.nn ! agrP3 Sg).p3 ++ vp.a2 ++ agent ++
|
||||
vp.inf.s ++
|
||||
vp.c2.s ++ --- junk if not TV
|
||||
vp.ext ++ vp.infExt ++ vp.s.s ! VPastPart af ;
|
||||
PastPartAgentAP vp np =
|
||||
let a = agrP3 Sg ;
|
||||
agent = appPrepNP P.von_Prep np
|
||||
in {
|
||||
s = \\af => (vp.nn ! a).p1 ++ (vp.nn ! a).p2 ++ (vp.nn ! a).p3
|
||||
++ vp.a2 ++ agent ++ vp.inf.inpl.p2
|
||||
++ vp.c2.s -- junk if not TV
|
||||
++ vp.ext ++ (vp.inf.extr ! a) ++ vp.s.s ! VPastPart af ;
|
||||
isPre = True ;
|
||||
c = <[],[]> ;
|
||||
ext = []
|
||||
@@ -138,37 +130,46 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
|
||||
m = tm.m ;
|
||||
subj = [] ;
|
||||
verb = vps.s ! ord ! agr ! VPFinite m t a ;
|
||||
haben = verb.inf2 ;
|
||||
neg = tm.s ++ p.s ++ vp.a1 ++ negation ! b ; -- HL 8/19 ++ vp.a1 ! b ;
|
||||
-- obj1 = (vp.nn ! agr).p1 ;
|
||||
-- obj = (vp.nn ! agr).p2 ;
|
||||
-- compl = obj1 ++ neg ++ obj ++ vp.a2 ; -- from EG 15/5
|
||||
obj1 = (vp.nn ! agr).p1 ++ (vp.nn ! agr).p2 ; -- refl ++ pronouns ++ nonpronouns
|
||||
obj2 = (vp.nn ! agr).p3 ; -- pp-objects
|
||||
obj1 = (vp.nn ! agr).p1 ++ (vp.nn ! agr).p2 ; -- refl ++ pronouns ++ light nps
|
||||
obj2 = (vp.nn ! agr).p3 ; -- pp-objects and heavy nps
|
||||
obj3 = (vp.nn ! agr).p4 ++ vp.adj ++ vp.a2 ; -- pred.AP|CN|Adv, via useComp HL 6/2019
|
||||
compl = obj1 ++ neg ++ obj2 ++ obj3 ;
|
||||
inf = vp.inf.s ++ verb.inf ++ verb.inf2 ;
|
||||
extra = vp.ext ;
|
||||
infE : Str = -- HL 30/6/2019
|
||||
case <t,a,vp.isAux> of {
|
||||
<Fut|Cond,Simul,True> => inf ; --# notpresent
|
||||
<Fut|Cond,Anter,True> -- Duden 318: kommen wollen haben => haben kommen wollen --# notpresent
|
||||
=> verb.inf2 ++ vp.inf.s ++ verb.inf ; --# notpresent
|
||||
<_,Anter,True> => inf ; --# notpresent
|
||||
_ => verb.inf ++ verb.inf2 ++ vp.inf.s } ;
|
||||
inffin : Str =
|
||||
case <t,a,vp.isAux> of {
|
||||
<Fut|Cond,Anter,True> -- ... wird|würde haben kommen wollen --# notpresent
|
||||
=> verb.fin ++ verb.inf2 ++ vp.inf.s ++ verb.inf ; --# notpresent
|
||||
<_,Anter,True> --# notpresent
|
||||
=> verb.fin ++ inf ; -- double inf --# notpresent
|
||||
_ => inf ++ verb.fin --- or just auxiliary vp
|
||||
} ;
|
||||
infObjs = (vp.inf.inpl.p1)!agr ; -- adapted to new VP.inf, HL 3/2022
|
||||
infPred = vp.inf.inpl.p2 ;
|
||||
infCompl : Str = case <t,a,vp.isAux> of {
|
||||
<Fut|Cond,Anter,True> => [] ; --# notpresent
|
||||
_ => infObjs ++ infPred } ;
|
||||
pred : {inf, infComplfin : Str} = case <t,a,vp.isAux> of {
|
||||
<Fut|Cond,Anter,True> => --# notpresent
|
||||
{inf = infObjs ++ haben ++ infPred ++ verb.inf ; --# notpresent Duden 318
|
||||
infComplfin = -- es ++ wird ++ haben ++ tun ++ wollen --# notpresent
|
||||
infObjs ++ verb.fin ++ haben ++ infPred ++ verb.inf} ; --# notpresent
|
||||
<_,Anter,True> => --# notpresent
|
||||
{inf = verb.inf ++ haben ; --# notpresent
|
||||
infComplfin = -- es ++ wird/hat/hatte ++ tun ++ wollen --# notpresent
|
||||
infObjs ++ verb.fin ++ infPred ++ verb.inf ++ haben} ; --# notpresent
|
||||
<Pres,_,_> =>
|
||||
{inf = verb.inf ++ haben ;
|
||||
infComplfin = -- es zu tun ++ [] ++ [] ++ versucht
|
||||
infCompl ++ verb.inf ++ haben ++ verb.fin}
|
||||
; --# notpresent
|
||||
_ => --# notpresent
|
||||
{inf = verb.inf ++ haben ; --# notpresent
|
||||
infComplfin = -- es zu tun ++ versucht ++ [] ++ hat --# notpresent
|
||||
infCompl ++ verb.inf ++ haben ++ verb.fin} --# notpresent
|
||||
} ;
|
||||
extra = vp.inf.extr!agr ++ vp.ext ;
|
||||
in
|
||||
case o of {
|
||||
Main => subj ++ verb.fin ++ compl ++ vp.infExt ++ infE ++ extra ;
|
||||
Inv => verb.fin ++ subj ++ compl ++ vp.infExt ++ infE ++ extra ;
|
||||
Sub => subj ++ compl ++ vp.infExt ++ inffin ++ extra
|
||||
}
|
||||
Main => subj ++ verb.fin ++ compl ++ infCompl ++ pred.inf ++ extra ;
|
||||
Inv => verb.fin ++ subj ++ compl ++ infCompl ++ pred.inf ++ extra ;
|
||||
Subj => subj ++ compl ++ pred.infComplfin ++ extra
|
||||
}
|
||||
} ;
|
||||
|
||||
ConjVPS = conjunctDistrTable2 Order Agr ;
|
||||
@@ -182,67 +183,78 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
|
||||
|
||||
ReflPoss num cn = {s = \\a,c => num.s ! cn.g ! c ++ possPron a num.n cn.g c ++ cn.s ! adjfCase Strong c ! num.n ! c} ;
|
||||
|
||||
ReflPron = { s = ResGer.reflPron } ; -- reflexively used personal pronoun, with special forms in P3 Sg
|
||||
|
||||
-- In P1,P2 we might use "selbst" to define a (stronger) reflexive pronoun instead: -- HL 3/2022
|
||||
-- du kennst mich vs. ich kenne mich selbst
|
||||
-- er kennt ihn vs. er kennt sich (selbst)
|
||||
-- sie kennen sich (selbst) =/= sie kennen einander
|
||||
-- Likewise, instead of ReflPoss we might define a reflexive possessive pronoun:
|
||||
-- du kennst meine Fehler vs. ich kenne meine eigenen Fehler
|
||||
-- er|sie|es kennt seine Fehler vs. er|sie|es kennt seine|ihre|seine eigenen Fehler
|
||||
oper
|
||||
reflPronSelf : Agr => Case => Str = \\a => \\c => reflPron ! a ! c ++ "selbst" ;
|
||||
|
||||
reflPossPron : Agr -> Number -> Gender -> Case -> Str =
|
||||
let eigen = adjForms "eigen" "eigen" in
|
||||
\a,n,g,c -> possPron a n g c ++ (eigen ! (AMod (gennum g n) c)) ;
|
||||
|
||||
-- implementation of some of the relevant Foc rules from Extra
|
||||
|
||||
lincat
|
||||
Foc = {s : Mood => ResGer.Tense => Anteriority => Polarity => Str} ;
|
||||
Foc = {s : Mood => ResGer.Tense => Anteriority => Polarity => Str} ;
|
||||
|
||||
lin
|
||||
FocObj np cl =
|
||||
let n = appPrepNP cl.c2 np
|
||||
in mkFoc n cl ;
|
||||
let n = appPrepNP cl.c2 np in mkFoc n cl ;
|
||||
|
||||
FocAdv adv cl = mkFoc adv.s cl ;
|
||||
FocAdv adv cl = mkFoc adv.s cl ;
|
||||
|
||||
FocAP ap np =
|
||||
let adj = ap.s ! APred ;
|
||||
vp = predV sein_V ** {ext = ap.c.p1 ++ ap.c.p2 ++ ap.ext};
|
||||
-- potentially not correct analysis for all examples
|
||||
-- works for:
|
||||
-- "treu ist sie ihm"
|
||||
-- "froh ist sie dass er da ist"
|
||||
-- "stolz ist sie auf ihn"
|
||||
subj = mkSubj np vp.subjc ;
|
||||
cl = mkClause subj.p1 subj.p2 vp
|
||||
in mkFoc adj cl ;
|
||||
FocAP ap np =
|
||||
let adj = ap.s ! APred ;
|
||||
vp = predV ResGer.sein_V ** {ext = ap.c.p1 ++ ap.c.p2 ++ ap.ext};
|
||||
-- potentially not correct analysis for all examples
|
||||
-- works for:
|
||||
-- "treu ist sie ihm"
|
||||
-- "froh ist sie dass er da ist"
|
||||
-- "stolz ist sie auf ihn"
|
||||
subj = mkSubj np vp.c1 ;
|
||||
cl = mkClause subj.p1 subj.p2 vp
|
||||
in mkFoc adj cl ;
|
||||
|
||||
UseFoc t p f = {s = t.s ++ p.s ++ f.s ! t.m ! t.t ! t.a ! p.p} ;
|
||||
UseFoc t p f = {s = t.s ++ p.s ++ f.s ! t.m ! t.t ! t.a ! p.p} ;
|
||||
|
||||
|
||||
-- extra rules to get some of the "es" alternative linearisations
|
||||
|
||||
lin
|
||||
EsVV vv vp = predV vv ** {
|
||||
nn = \\a => let n = vp.nn ! a in <"es" ++ n.p1, n.p2, n.p3, n.p4, n.p5, n.p6> ;
|
||||
inf = vp.inf ** {s = vp.s.s ! (VInf True) ++ vp.inf.s} ; -- ich genieße es zu versuchen zu gehen; alternative word order could be produced by vp.inf ++ vp.s.s... (zu gehen zu versuchen)
|
||||
a1 = vp.a1 ;
|
||||
a2 = vp.a2 ;
|
||||
ext = vp.ext ;
|
||||
infExt = vp.infExt ;
|
||||
adj = vp.adj } ;
|
||||
|
||||
EsV2A v2a ap s = predV v2a ** {
|
||||
nn = \\_ => <"es",[],[],[],[],[]> ;
|
||||
adj = ap.s ! APred ;
|
||||
ext = "," ++ "dass" ++ s.s ! Sub} ;
|
||||
EsVV vv vp = -- HL 3/2022
|
||||
let inf = mkInf False Simul Pos vp ; -- False = force extraction
|
||||
objs : Agr => Str * Str * Str * Str = \\a => <"es",[],[],[]> ;
|
||||
vps = predV vv ** { nn = objs }
|
||||
in insertExtrapos vp.ext (
|
||||
insertInf inf vps) ;
|
||||
|
||||
EsV2A v2a ap s = predV v2a ** {
|
||||
nn = \\_ => <"es",[],[],[]> ;
|
||||
adj = ap.s ! APred ;
|
||||
ext = "," ++ conjThat ++ s.s ! Sub} ;
|
||||
|
||||
-- "es wird gelacht"; generating formal sentences
|
||||
|
||||
lincat
|
||||
FClause = ResGer.VP ** {subj : ResGer.NP} ;
|
||||
|
||||
FClause = ResGer.VP ** {subj : ResGer.NP} ;
|
||||
|
||||
lin
|
||||
VPass v =
|
||||
let vp = predV werdenPass ;
|
||||
in vp ** {
|
||||
subj = esSubj ;
|
||||
inf = vp.inf ** {s = v.s ! VPastPart APred } } ; -- construct the formal clause
|
||||
VPass v =
|
||||
let vp = predV werdenPass
|
||||
in vp ** {subj = esSubj ;
|
||||
inf = vp.inf ** {s = v.s ! VPastPart APred } } ; -- construct the formal clause
|
||||
|
||||
AdvFor adv fcl = fcl ** {a2 = adv.s} ;
|
||||
AdvFor adv fcl = fcl ** {a2 = adv.s} ;
|
||||
|
||||
FtoCl cl =
|
||||
let subj = mkSubj cl.subj cl.subjc
|
||||
let subj = mkSubj cl.subj cl.c1
|
||||
in DisToCl subj.p1 subj.p2 cl ;
|
||||
|
||||
|
||||
@@ -251,16 +263,14 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
|
||||
mkFoc : Str -> Cl -> Foc = \focus, cl ->
|
||||
lin Foc {s = \\m,t,a,p => focus ++ cl.s ! m ! t ! a ! p ! Inv} ;
|
||||
|
||||
esSubj : NP = lin NP {
|
||||
s = \\_ => "es" ;
|
||||
rc, ext = [] ;
|
||||
a = Ag Neutr Sg P3 ;
|
||||
-- isLight = True ;
|
||||
-- isPron = True
|
||||
w = WPron
|
||||
} ;
|
||||
esSubj : CatGer.NP = lin NP {
|
||||
s = \\_ => "es" ;
|
||||
rc, ext = [] ;
|
||||
a = Ag Neutr Sg P3 ;
|
||||
w = WPron
|
||||
} ;
|
||||
|
||||
DisToCl : Str -> Agr -> FClause -> Clause = \subj,agr,vp ->
|
||||
DisToCl : Str -> Agr -> FClause -> Clause = \subj,agr,vp ->
|
||||
let vps = useVP vp in {
|
||||
s = \\m,t,a,b,o =>
|
||||
let
|
||||
@@ -273,20 +283,23 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
|
||||
obj1 = (vp.nn ! agr).p1 ;
|
||||
obj2 = (vp.nn ! agr).p2 ++ (vp.nn ! agr).p3 ;
|
||||
compl = obj1 ++ neg ++ vp.adj ++ obj2 ++ vp.a2 ; -- adj added
|
||||
inf = vp.inf.s ++ verb.inf ; -- not used for linearisation of Main/Inv
|
||||
inf = vp.inf.inpl.p2 ++ verb.inf ; -- not used for linearisation of Main/Inv
|
||||
infExt = vp.inf.extr ! agr ;
|
||||
extra = vp.ext ;
|
||||
inffin : Str =
|
||||
inffin : Str =
|
||||
case <a,vp.isAux> of {
|
||||
<Anter,True> => verb.fin ++ inf ; -- double inf --# notpresent
|
||||
_ => inf ++ verb.fin --- or just auxiliary vp
|
||||
_ => inf ++ verb.fin --- or just auxiliary vp
|
||||
}
|
||||
in
|
||||
case o of {
|
||||
Main => subj ++ verb.fin ++ compl ++ vp.infExt ++ verb.inf ++ extra ++ vp.inf.s ;
|
||||
Inv => verb.fin ++ compl ++ vp.infExt ++ verb.inf ++ extra ++ vp.inf.s ;
|
||||
Sub => compl ++ vp.infExt ++ inffin ++ extra }
|
||||
Main => subj ++ verb.fin ++ compl ++ infExt ++ verb.inf ++ extra ++ vp.inf.inpl.p2 ;
|
||||
Inv => verb.fin ++ compl ++ infExt ++ verb.inf ++ extra ++ vp.inf.inpl.p2 ; -- vp.inf.s ;
|
||||
Sub => compl ++ infExt ++ inffin ++ extra }
|
||||
} ;
|
||||
|
||||
-- this function is not entirely satisfactory as largely
|
||||
-- though not entirely duplicating mkClause in ResGer
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user