mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-02 15:52:50 -06:00
German resource grammar: major changes.
This commit is contained in:
@@ -32,22 +32,25 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
|
||||
|
||||
moegen_VV = auxVV mögen_V ;
|
||||
|
||||
ICompAP ap = {s = \\_ => "wie" ++ ap.s ! APred} ;
|
||||
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}} ;
|
||||
CompIQuant iq = {s = table {Ag g n p => iq.s ! n ! g ! Nom} ; ext = ""} ;
|
||||
|
||||
IAdvAdv adv = {s = "wie" ++ adv.s} ;
|
||||
|
||||
DetNPMasc det = {
|
||||
s = \\c => det.sp ! Masc ! c ; ---- genders
|
||||
a = agrP3 det.n ;
|
||||
isPron = False
|
||||
isPron = False ;
|
||||
ext, adv, rc = []
|
||||
} ;
|
||||
|
||||
DetNPFem det = {
|
||||
s = \\c => det.sp ! Fem ! c ; ---- genders
|
||||
a = agrP3 det.n ;
|
||||
isPron = False
|
||||
isPron = False ;
|
||||
ext, adv, rc = []
|
||||
} ;
|
||||
|
||||
EmptyRelSlash slash = {
|
||||
@@ -57,25 +60,36 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
|
||||
c = (prepC slash.c2.c).c
|
||||
} ;
|
||||
|
||||
PassVPSlash vp = insertObj (\\_ => (PastPartAP (lin VPSlash vp)).s ! APred) (predV werdenPass) ;
|
||||
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
|
||||
|
||||
PassAgentVPSlash vp np = ---- "von" here, "durch" in StructuralGer
|
||||
insertObj (\\_ => (PastPartAgentAP (lin VPSlash vp) (lin NP np)).s ! APred) (predV werdenPass) ;
|
||||
|
||||
PastPartAP vp = {
|
||||
s = \\af => (vp.nn ! agrP3 Sg).p1 ++ (vp.nn ! agrP3 Sg).p2 ++ vp.a2 ++ vp.inf ++
|
||||
vp.c2.s ++ --- junk if not TV
|
||||
vp.ext ++ vp.infExt ++ vp.s.s ! VPastPart af ;
|
||||
isPre = True
|
||||
isPre = True ;
|
||||
c = <[],[]> ;
|
||||
ext = []
|
||||
} ;
|
||||
|
||||
PastPartAgentAP vp np =
|
||||
let agent = appPrep P.von_Prep np.s
|
||||
let agent = appPrepNP P.von_Prep np
|
||||
in {
|
||||
s = \\af => (vp.nn ! agrP3 Sg).p1 ++ (vp.nn ! agrP3 Sg).p2 ++ vp.a2 ++ agent ++ vp.inf ++
|
||||
vp.c2.s ++ --- junk if not TV
|
||||
vp.ext ++ vp.infExt ++ vp.s.s ! VPastPart af ;
|
||||
isPre = True
|
||||
isPre = True ;
|
||||
c = <[],[]> ;
|
||||
ext = []
|
||||
} ;
|
||||
|
||||
lincat
|
||||
@@ -114,7 +128,7 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
|
||||
m = tm.m ;
|
||||
subj = [] ;
|
||||
verb = vps.s ! ord ! agr ! VPFinite m t a ;
|
||||
neg = vp.a1 ! b ;
|
||||
neg = tm.s ++ p.s ++ vp.a1 ! b ;
|
||||
obj0 = (vp.nn ! agr).p1 ;
|
||||
obj = (vp.nn ! agr).p2 ;
|
||||
compl = obj0 ++ neg ++ obj ++ vp.a2 ; -- from EG 15/5
|
||||
@@ -136,4 +150,108 @@ concrete ExtraGer of ExtraGerAbs = CatGer **
|
||||
ConjVPS = conjunctDistrTable2 Order Agr ;
|
||||
|
||||
|
||||
-- implementation of some of the relevant Foc rules from Extra
|
||||
|
||||
lincat
|
||||
Foc = {s : Mood => ResGer.Tense => Anteriority => Polarity => Str} ;
|
||||
|
||||
lin
|
||||
FocObj np cl =
|
||||
let n = appPrepNP cl.c2 np
|
||||
in mkFoc n 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 ;
|
||||
|
||||
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 > ;
|
||||
inf = vp.s.s ! (VInf True) ++ vp.inf ; -- 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} ;
|
||||
|
||||
-- "es wird gelacht"; generating formal sentences
|
||||
|
||||
lincat
|
||||
FClause = VP ** {subj : NP} ;
|
||||
|
||||
|
||||
lin
|
||||
VPass v =
|
||||
let vp = predV werdenPass ;
|
||||
in vp ** {
|
||||
subj = esSubj ;
|
||||
inf = v.s ! VPastPart APred } ; -- construct the formal clause
|
||||
|
||||
AdvFor adv fcl = fcl ** {a2 = adv.s} ;
|
||||
|
||||
FtoCl cl =
|
||||
let subj = mkSubj cl.subj cl.subjc
|
||||
in DisToCl subj.p1 subj.p2 cl ;
|
||||
|
||||
|
||||
oper -- extra operations for ExtraGer
|
||||
|
||||
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, adv = [] ;
|
||||
a = Ag Neutr Sg P3 ;
|
||||
isPron = True} ;
|
||||
|
||||
DisToCl : Str -> Agr -> FClause -> Clause = \subj,agr,vp ->
|
||||
let vps = useVP vp in {
|
||||
s = \\m,t,a,b,o =>
|
||||
let
|
||||
ord = case o of {
|
||||
Sub => True ; -- glue prefix to verb
|
||||
_ => False
|
||||
} ;
|
||||
verb = vps.s ! ord ! agr ! VPFinite m t a ;
|
||||
neg = vp.a1 ! b ;
|
||||
obj0 = (vp.nn ! agr).p1 ;
|
||||
obj = (vp.nn ! agr).p2 ;
|
||||
compl = obj0 ++ neg ++ vp.adj ++ obj ++ vp.a2 ; -- adj added
|
||||
inf = vp.inf ++ verb.inf ; -- not used for linearisation of Main/Inv
|
||||
extra = vp.ext ;
|
||||
inffin : Str =
|
||||
case <a,vp.isAux> of {
|
||||
<Anter,True> => verb.fin ++ inf ; -- double inf --# notpresent
|
||||
_ => inf ++ verb.fin --- or just auxiliary vp
|
||||
}
|
||||
in
|
||||
case o of {
|
||||
Main => subj ++ verb.fin ++ compl ++ vp.infExt ++ verb.inf ++ extra ++ vp.inf ;
|
||||
Inv => verb.fin ++ compl ++ vp.infExt ++ verb.inf ++ extra ++ vp.inf ;
|
||||
Sub => compl ++ vp.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