From ba14a8a7e56f25f2a7f4357ec862bea5e78a803a Mon Sep 17 00:00:00 2001 From: scharolta_siencnik Date: Thu, 23 Jul 2015 15:50:05 +0000 Subject: [PATCH] German resource grammar: major changes. --- lib/src/german/AdjectiveGer.gf | 74 +++++++++------ lib/src/german/AdverbGer.gf | 2 +- lib/src/german/CatGer.gf | 20 ++-- lib/src/german/ConjunctionGer.gf | 34 +++++-- lib/src/german/ExtraGer.gf | 138 +++++++++++++++++++++++++-- lib/src/german/ExtraGerAbs.gf | 14 ++- lib/src/german/IdiomGer.gf | 3 +- lib/src/german/IrregGer.gf | 2 +- lib/src/german/LexiconGer.gf | 10 +- lib/src/german/MorphoGer.gf | 5 +- lib/src/german/NounGer.gf | 117 +++++++++++------------ lib/src/german/ParadigmsGer.gf | 45 ++++----- lib/src/german/QuestionGer.gf | 6 +- lib/src/german/ResGer.gf | 158 ++++++++++++++++--------------- lib/src/german/SentenceGer.gf | 31 +++--- lib/src/german/StructuralGer.gf | 10 +- lib/src/german/SymbolGer.gf | 9 +- lib/src/german/VerbGer.gf | 25 ++--- 18 files changed, 447 insertions(+), 256 deletions(-) diff --git a/lib/src/german/AdjectiveGer.gf b/lib/src/german/AdjectiveGer.gf index 8f36afd8e..c014c6246 100644 --- a/lib/src/german/AdjectiveGer.gf +++ b/lib/src/german/AdjectiveGer.gf @@ -6,54 +6,72 @@ concrete AdjectiveGer of Adjective = CatGer ** open ResGer, Prelude in { PositA a = { s = a.s ! Posit ; - isPre = True + isPre = True ; + c = <[],[]> ; + ext = [] } ; ComparA a np = { - s = \\af => a.s ! Compar ! af ++ conjThan ++ np.s ! NPC Nom ; - isPre = True + s = \\af => a.s ! Compar ! af ++ conjThan ++ np.s ! NPC Nom ++ bigNP np ; + isPre = True ; + c = <[],[]> ; + ext = [] } ; - CAdvAP ad ap np = { - s = \\af => ad.s ++ ap.s ! af ++ ad.p ++ np.s ! NPC Nom ; - isPre = False + CAdvAP ad ap np = ap ** { + s = \\af => ad.s ++ ap.s ! af ++ ad.p ++ np.s ! NPC Nom ++ bigNP np ; + isPre = False } ; UseComparA a = { s = \\af => a.s ! Compar ! af ; - isPre = True + isPre = True ; + c = <[],[]> ; + ext = [] } ; - AdjOrd a = { + + AdjOrd a = { s = a.s ; - isPre = True - } ; + isPre = True ; + c = <[],[]> ; + ext = [] + } ; -- $SuperlA$ belongs to determiner syntax in $Noun$. - ComplA2 a np = { - s = table { - APred => a.s ! Posit ! APred ++ appPrep a.c2 np.s ; - af => appPrep a.c2 np.s ++ a.s ! Posit ! af - } ; - isPre = True + ComplA2 a np = + let CExt = case a.c2.isPrep of { + False => ; + True => <[], appPrepNP a.c2 np> } + in { + s = a.s ! Posit ; + isPre = True ; + c = CExt ; + ext = [] } ; - ReflA2 a = { - s = \\af => a.s ! Posit ! APred ++ - appPrep a.c2 (\\k => usePrepC k (\c -> reflPron ! agrP3 Sg ! c)) ; --- agr - isPre = True + ReflA2 a = + let + compl = appPrep a.c2 (\\k => usePrepC k (\c -> reflPron ! agrP3 Sg ! c)) ; + CExt = case a.c2.isPrep of + {False => ; + True => <[], compl> } + in { + s = a.s ! Posit ; + isPre = True ; + c = CExt ; + ext = [] } ; - SentAP ap sc = { - s = \\a => ap.s ! a ++ sc.s ; - isPre = False + SentAP ap sc = ap ** { + isPre = False ; + ext = ap.ext ++ sc.s } ; - AdAP ada ap = { - s = \\a => ada.s ++ ap.s ! a ; - isPre = ap.isPre - } ; + AdAP ada ap = ap ** {s = \\a => ada.s ++ ap.s ! a} ; UseA2 a = { s = a.s ! Posit ; - isPre = True + isPre = True ; + c = <[],[]> ; + ext = [] } ; } diff --git a/lib/src/german/AdverbGer.gf b/lib/src/german/AdverbGer.gf index 5cc936292..df7774411 100644 --- a/lib/src/german/AdverbGer.gf +++ b/lib/src/german/AdverbGer.gf @@ -10,7 +10,7 @@ concrete AdverbGer of Adverb = CatGer ** open ResGer, Prelude in { s = cadv.s ++ a.s ! Posit ! APred ++ cadv.p ++ s.s ! Sub } ; - PrepNP prep np = {s = appPrep prep np.s} ; + PrepNP prep np = {s = appPrepNP prep np} ; AdAdv = cc2 ; diff --git a/lib/src/german/CatGer.gf b/lib/src/german/CatGer.gf index 2f9c50a6d..1bd34c7f3 100644 --- a/lib/src/german/CatGer.gf +++ b/lib/src/german/CatGer.gf @@ -26,7 +26,7 @@ concrete CatGer of Cat = QCl = {s : Mood => ResGer.Tense => Anteriority => Polarity => QForm => Str} ; IP = {s : Case => Str ; n : Number} ; - IComp = {s : Agr => Str} ; + IComp = {s : Agr => Str ; ext : Str} ; IDet = {s : Gender => Case => Str ; n : Number} ; IQuant = {s : Number => Gender => Case => Str} ; @@ -39,16 +39,23 @@ concrete CatGer of Cat = VP = ResGer.VP ; VPSlash = ResGer.VPSlash ; - Comp = {s : Agr => Str} ; + Comp = {s : Agr => Str ; ext : Str} ; -- Adjective - AP = {s : AForm => Str ; isPre : Bool} ; + AP = {s : AForm => Str ; isPre : Bool ; c: Str * Str ; ext : Str} ; + -- ich bin [c1 ihm] treu + -- du bist so klug gewesen [ext ihn zu lesen] + -- ich bin stolz [c2 auf dich] -- Noun - CN = {s : Adjf => Number => Case => Str ; g : Gender} ; - NP = {s : PCase => Str ; a : Agr ; isPron : Bool} ; + CN = {s : Adjf => Number => Case => Str ; + rc : Number => Str ; -- Frage , [rc die ich gestellt habe] + ext : Str ; -- Frage , [sc wo sie schläft]) + adv : Str ; -- Frage [a von Max] + g : Gender} ; + NP = ResGer.NP ; Pron = {s : NPForm => Str ; a : Agr} ; Det = {s,sp : Gender => PCase => Str ; n : Number ; a : Adjf ; isDef : Bool} ; Quant = { @@ -91,7 +98,7 @@ concrete CatGer of Cat = N = ResGer.Noun ; N2 = ResGer.Noun ** {c2 : Preposition} ; N3 = ResGer.Noun ** {c2,c3 : Preposition} ; - PN = {s : Case => Str} ; + PN = {s : Case => Str; g : Gender} ; -- tense with possibility to choose conjunctive forms @@ -108,6 +115,7 @@ concrete CatGer of Cat = V, VS, VQ, VA = \v -> useInfVP False (predV v) ; V2, V2A, V2Q, V2S = \v -> useInfVP False (predV v) ++ v.c2.s ; V3 = \v -> useInfVP False (predV v) ++ v.c2.s ++ v.c3.s ; + VV = \v -> useInfVP v.isAux (predVGen v.isAux v) ; V2V = \v -> useInfVP v.isAux (predVGen v.isAux v) ++ v.c2.s ; diff --git a/lib/src/german/ConjunctionGer.gf b/lib/src/german/ConjunctionGer.gf index 739250ad7..272a2d1b2 100644 --- a/lib/src/german/ConjunctionGer.gf +++ b/lib/src/german/ConjunctionGer.gf @@ -10,12 +10,11 @@ concrete ConjunctionGer of Conjunction = ConjAdv conj ss = conjunctDistrSS conj ss ; ConjNP conj ss = heavyNP (conjunctDistrTable PCase conj ss ** { - a = Ag Fem (conjNumber conj.n (numberAgr ss.a)) (personAgr ss.a) + a = Ag Fem (conjNumber conj.n (numberAgr ss.a)) (personAgr ss.a) ; }) ; ConjAP conj ss = conjunctDistrTable AForm conj ss ** { - isPre = ss.isPre - } ; + isPre = ss.isPre ; c = ss.c ; ext = ss.ext} ; ConjRS conj ss = conjunctDistrTable RelGenNum conj ss ** { c = ss.c @@ -35,10 +34,26 @@ concrete ConjunctionGer of Conjunction = BaseAdv = twoSS ; ConsAdv = consrSS comma ; - BaseNP x y = twoTable PCase x y ** {a = conjAgr x.a y.a} ; - ConsNP xs x = consrTable PCase comma xs x ** {a = conjAgr xs.a x.a} ; - BaseAP x y = twoTable AForm x y ** {isPre = andB x.isPre y.isPre} ; - ConsAP xs x = consrTable AForm comma xs x ** {isPre = andB xs.isPre x.isPre} ; + BaseNP x y = { + s1 = \\c => x.s ! c ++ bigNP x ; + s2 = \\c => y.s ! c ++ bigNP y ; + a = conjAgr x.a y.a } ; + ConsNP xs x = { + s1 = \\c => xs.s ! c ++ bigNP xs ++ comma ++ x.s1 ! c ; + s2 = x.s2 ; + a = conjAgr xs.a x.a } ; + BaseAP x y = { + s1 = bigAP x ; + s2 = bigAP y ; + isPre = andB x.isPre y.isPre ; + c = <[],[]> ; + ext = []} ; + ConsAP xs x = { + s1 = \\a => (bigAP xs) ! a ++ comma ++ x.s1 ! a ; + s2 = x.s2 ; + isPre = andB x.isPre xs.isPre ; + c = <[],[]> ; + ext = []} ; BaseRS x y = twoTable RelGenNum x y ** {c = y.c} ; ConsRS xs x = consrTable RelGenNum comma xs x ** {c = xs.c} ; @@ -46,7 +61,10 @@ concrete ConjunctionGer of Conjunction = [S] = {s1,s2 : Order => Str} ; [Adv] = {s1,s2 : Str} ; [NP] = {s1,s2 : PCase => Str ; a : Agr} ; - [AP] = {s1,s2 : AForm => Str ; isPre : Bool} ; + [AP] = {s1,s2 : AForm => Str ; isPre : Bool; c : Str * Str ; ext : Str} ; [RS] = {s1,s2 : RelGenNum => Str ; c : Case} ; + oper + bigAP : AP -> AForm => Str = \ap -> + \\a => ap.c.p1 ++ ap.s ! a ++ ap.c.p2 ++ ap.ext; } diff --git a/lib/src/german/ExtraGer.gf b/lib/src/german/ExtraGer.gf index 6d7642adc..a76e56c0e 100644 --- a/lib/src/german/ExtraGer.gf +++ b/lib/src/german/ExtraGer.gf @@ -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 of { + => 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 of { + => 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 } diff --git a/lib/src/german/ExtraGerAbs.gf b/lib/src/german/ExtraGerAbs.gf index 26496392e..7e1ae97a8 100644 --- a/lib/src/german/ExtraGerAbs.gf +++ b/lib/src/german/ExtraGerAbs.gf @@ -2,8 +2,13 @@ abstract ExtraGerAbs = Extra [ VPI,ListVPI,BaseVPI,ConsVPI,MkVPI,ComplVPIVV,ConjVPI,ClSlash,RCl, VPS,ListVPS,BaseVPS,ConsVPS,ConjVPS,MkVPS,PredVPS,EmptyRelSlash, VPSlash, PassVPSlash, PassAgentVPSlash, CompIQuant, PastPartAP, PastPartAgentAP, - Temp,Tense,Pol,S,NP,VV,VP,Conj,IAdv,IQuant,IComp,ICompAP,IAdvAdv,Adv,AP] ** { + Temp,Tense,Pol,S,NP,VV,VP,Conj,IAdv,IQuant,IComp,ICompAP,IAdvAdv,Adv,AP, + Foc,FocObj,FocAdv,FocAP,UseFoc] ** { flags coding=utf8; + + cat + FClause ; -- formal clause + fun PPzuAdv : CN -> Adv ; -- zum Lied, zur Flasche TImpfSubj : Tense ; -- ich möchte... --# notpresent @@ -11,4 +16,11 @@ abstract ExtraGerAbs = Extra [ moegen_VV : VV ; -- ich mag/möchte singen DetNPMasc, DetNPFem : Det -> NP ; + + EsVV : VV -> VP -> VP ; -- ich genieße es zu schlafen + EsV2A : V2A -> AP -> S -> VP ; -- ich finde es schön, dass ... + + VPass : V -> FClause ; -- (es) wird getanzt + AdvFor : Adv -> FClause -> FClause ; -- es wird heute gelacht - addition of adverbs + FtoCl : FClause -> Cl ; -- embedding FClause within the RGL, to allow generation of S, Utt, etc. } diff --git a/lib/src/german/IdiomGer.gf b/lib/src/german/IdiomGer.gf index 0d5a0a8f4..fd2a6d2ce 100644 --- a/lib/src/german/IdiomGer.gf +++ b/lib/src/german/IdiomGer.gf @@ -68,7 +68,8 @@ concrete IdiomGer of Idiom = CatGer ** SelfNP np = { s = \\c => np.s ! c ++ "selbst" ; a = np.a ; - isPron = False + isPron = False ; + adv, rc, ext = [] } ; oper diff --git a/lib/src/german/IrregGer.gf b/lib/src/german/IrregGer.gf index e47436316..ebfca92b7 100644 --- a/lib/src/german/IrregGer.gf +++ b/lib/src/german/IrregGer.gf @@ -43,7 +43,7 @@ in { lin erlöschen_V = irregV "erlöschen" "erlischt" "erlosch" "erlösche" "erloschen" ; lin erkennen_V = irregV "erkennen" "erkennt" "erkannte" "erkannte" "erkannt" ; lin erschrecken_V = irregV "erschrecken" "erschrickt" "erschrak" "erschräke" "erschrocken" ; - lin essen_V = irregV "essen" "ißt" "aß" "äße" "gegessen" ; + lin essen_V = irregV "essen" "isst" "aß" "äße" "gegessen" ; lin fahren_V = irregV "fahren" "fährt" "fuhr" "führe" "gefahren" ; lin fallen_V = irregV "fallen" "fällt" "fiel" "fiele" "gefallen" ; lin fangen_V = irregV "fangen" "fängt" "fing" "finge" "gefangen" ; diff --git a/lib/src/german/LexiconGer.gf b/lib/src/german/LexiconGer.gf index 30dc3d2bb..8fa6f6fdf 100644 --- a/lib/src/german/LexiconGer.gf +++ b/lib/src/german/LexiconGer.gf @@ -57,14 +57,14 @@ lin clean_A = regA "rein" ; clever_A = mk3A "klug" "klüger" "klügste" ; close_V2 = dirV2 Irreg.schließen_V ; - coat_N = mkN "Jacke" ; + coat_N = mkN "Jacke" | mkN "Mantel" "Mantel" masculine; cold_A = regA "kalt" ; come_V = seinV (mk6V "kommen" "kommt" "komm" "kam" "käme" "gekommen") ; computer_N = reg2N "Rechner" "Rechner" masculine ; country_N = reg2N "Land" "Länder" neuter ; cousin_N = reg2N "Vetter" "Vetter" masculine ; --- Kusine cow_N = reg2N "Kuh" "Kühe" feminine ; - die_V = seinV Irreg.sterben_V ; + die_V = seinV Irreg.sterben_V | seinV (prefixV "um" Irreg.kommen_V); distance_N3 = mkN3 (mkN "Entfernung") von_Prep zu_Prep ; dirty_A = regA "schmutzig" ; do_V2 = dirV2 Irreg.tun_V ; @@ -141,7 +141,7 @@ lin open_V2 = dirV2 (regV "öffnen") ; paint_V2A = mkV2A (regV "malen") accPrep ; paper_N = reg2N "Papier" "Papiere" neuter ; - paris_PN = mkPN "Paris" ; -- neuter ; + paris_PN = mkPN "Paris" neuter ; peace_N = mk6N "Friede" "Frieden" "Frieden" "Friedens" "Frieden" "Frieden" masculine ; pen_N = mkN "Bleistift" ; ---- planet_N = reg2N "Planet" "Planeten" masculine ; @@ -328,7 +328,7 @@ lin stand_V = Irreg.stehen_V ; swell_V = prefixV "an" (regV "schwellen") ; swim_V = seinV (Irreg.schwimmen_V) ; - think_V = Irreg.denken_V ; + think_V = Irreg.denken_V | prefixV "nach" Irreg.denken_V; turn_V = regV "drehen" ; vomit_V = regV "kotzen" ; bite_V2 = dirV2 Irreg.beißen_V ; @@ -357,7 +357,7 @@ lin language_N = mkN "Sprache" ; rule_N = reg2N "Regel" "Regeln" feminine ; - john_PN = mkPN "Johann" ; -- should be: masculine ; + john_PN = mkPN "Johann" masculine ; question_N = mkN "Frage" ; ready_A = regA "fertig" ; reason_N = reg2N "Grund" "Gründe" masculine ; diff --git a/lib/src/german/MorphoGer.gf b/lib/src/german/MorphoGer.gf index 492ee11c7..3b887b0b2 100644 --- a/lib/src/german/MorphoGer.gf +++ b/lib/src/german/MorphoGer.gf @@ -20,9 +20,10 @@ oper mkPrep : Str -> PCase -> Preposition = \s,c -> {s = s ; s2 = [] ; c = c ; isPrep = True} ; - nameNounPhrase : {s : Case => Str} -> {s : PCase => Str ; a : Agr ; isPron : Bool} = \name -> heavyNP { + nameNounPhrase : {s : Case => Str} -> {s : PCase => Str ; a : Agr ; isPron : Bool ; ext,adv,rc : Str} = \name -> heavyNP { s = \\c => usePrepC c (\k -> name.s ! k) ; - a = agrP3 Sg + a = agrP3 Sg ; + ext, adv, rc = [] -- added } ; detLikeAdj : Bool -> Number -> Str -> diff --git a/lib/src/german/NounGer.gf b/lib/src/german/NounGer.gf index f707eae71..993f77f73 100644 --- a/lib/src/german/NounGer.gf +++ b/lib/src/german/NounGer.gf @@ -7,48 +7,58 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in { s = \\c => det.s ! cn.g ! c ++ (let k = (prepC c).c in cn.s ! adjfCase det.a k ! det.n ! k) ; a = agrgP3 cn.g det.n ; - isPron = det.isDef -- ich sehe den Mann nicht vs. ich sehe nicht einen Mann + isPron = det.isDef ; -- ich sehe den Mann nicht vs. ich sehe nicht einen Mann + rc = cn.rc ! det.n ; + adv = cn.adv ; + ext = cn.ext } ; DetNP det = { s = \\c => det.sp ! Neutr ! c ; -- more genders in ExtraGer a = agrP3 det.n ; - isPron = det.isDef + isPron = det.isDef ; + rc, adv, ext = [] } ; UsePN pn = { s = \\c => usePrepC c (\k -> pn.s ! k) ; - a = agrP3 Sg ; - isPron = True --- means: this is not a heavy NP, but comes before negation + a = agrgP3 pn.g Sg ; + isPron = True ; --- means: this is not a heavy NP, but comes before negation + rc, adv, ext = [] } ; UsePron pron = { s = \\c => usePrepC c (\k -> pron.s ! NPCase k) ; a = pron.a ; - isPron = True + isPron = True ; + rc, adv, ext = [] } ; PredetNP pred np = - let ag = case pred.a of {PAg n => agrP3 n ; _ => np.a} in heavyNP { + let ag = case pred.a of {PAg n => agrP3 n ; _ => np.a} in np ** { s = \\c0 => let c = case pred.c.k of {NoCase => c0 ; PredCase k => k} in pred.s ! numberAgr ag ! genderAgr np.a ! c0 ++ pred.c.p ++ np.s ! c ; - a = ag + a = ag ; + isPron = False } ; - PPartNP np v2 = heavyNP { + PPartNP np v2 = np ** { s = \\c => np.s ! c ++ v2.s ! VPastPart APred ; --- invar part - a = np.a + isPron = False + } ; + {- possibly structures such as + "sie ist eine erfolgreiche Frau geliebt von vielen" + but only with v2 not possible in German? -} + + AdvNP np adv = np ** { + adv = np.adv ++ adv.s ; + isPron = False } ; - AdvNP np adv = heavyNP { - s = \\c => np.s ! c ++ adv.s ; - a = np.a - } ; - - ExtAdvNP np adv = heavyNP { - s = \\c => np.s ! c ++ embedInCommas adv.s ; - a = np.a + ExtAdvNP np adv = np ** { + adv = np.adv ++ embedInCommas adv.s ; + isPron = False } ; DetQuantOrd quant num ord = @@ -131,79 +141,70 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in { MassNP cn = { s = \\c => usePrepC c (\k -> cn.s ! Strong ! Sg ! k) ; a = agrgP3 cn.g Sg ; - isPron = False + isPron = False ; + rc = cn.rc ! Sg ; + adv = cn.adv ; + ext = cn.ext } ; UseN, UseN2 = \n -> { s = \\_ => n.s ; - g = n.g + g = n.g ; + rc = \\_ => [] ; + ext,adv = [] } ; ComplN2 f x = { - s = \\_,n,c => f.s ! n ! c ++ appPrep f.c2 x.s ; - g = f.g + s = \\_,n,c => f.s ! n ! c ++ appPrepNP f.c2 x ; + g = f.g ; + rc = \\_ => [] ; + ext,adv = [] } ; ComplN3 f x = { - s = \\n,c => f.s ! n ! c ++ appPrep f.c2 x.s ; - co = f.co ++ appPrep f.c2 x.s ; ---- should not occur at all; the abstract syntax is problematic in giving N2 + s = \\n,c => f.s ! n ! c ++ appPrepNP f.c2 x ; + co = f.co ++ appPrepNP f.c2 x ; ---- should not occur at all; the abstract syntax is problematic in giving N2 uncap = { - s = \\n,c => f.uncap.s ! n ! c ++ appPrep f.c2 x.s ; - co = f.uncap.co ++ appPrep f.c2 x.s ; ---- should not occur at all; the abstract syntax is problematic in giving N2 + s = \\n,c => f.uncap.s ! n ! c ++ appPrepNP f.c2 x ; + co = f.uncap.co ++ appPrepNP f.c2 x ; ---- should not occur at all; the abstract syntax is problematic in giving N2 } ; g = f.g ; - c2 = f.c3 + c2 = f.c3 ; + rc = \\_ => [] ; + ext,adv = [] } ; Use2N3 f = f ; Use3N3 f = f ** { - c2 = f.c3 + c2 = f.c3; } ; AdjCN ap cn = let g = cn.g - in { + in cn ** { s = \\a,n,c => preOrPost ap.isPre - (ap.s ! agrAdj g a n c) + (ap.c.p1 ++ ap.c.p2 ++ ap.s ! agrAdj g a n c ++ ap.ext) (cn.s ! a ! n ! c) ; g = g } ; - RelCN cn rs = { - s = \\a,n,c => cn.s ! a ! n ! c ++ "," ++ - rs.s ! RGenNum (gennum cn.g n) ; - g = cn.g - } ; + + RelCN cn rs = cn ** {rc = \\n => embedInCommas (rs.s ! RGenNum (gennum cn.g n))} ; - RelNP np rs = { - s = \\c => np.s ! c ++ "," ++ - rs.s ! RGenNum (gennum (genderAgr np.a) (numberAgr np.a)) ; - a = np.a ; - isPron = False - } ; + RelNP np rs = np ** { + rc = embedInCommas (rs.s ! RGenNum (gennum (genderAgr np.a) (numberAgr np.a))) ; + isPron = False } ; - SentCN cn s = { - s = \\a,n,c => cn.s ! a ! n ! c ++ s.s ; - g = cn.g - } ; + SentCN cn s = cn ** {ext = embedInCommas s.s} ; - AdvCN cn s = { - s = \\a,n,c => cn.s ! a ! n ! c ++ s.s ; - g = cn.g - } ; + AdvCN cn a = cn ** {adv = a.s} ; - ApposCN cn np = let g = cn.g in { - s = \\a,n,c => cn.s ! a ! n ! c ++ np.s ! NPC c ; - g = g ; - isMod = cn.isMod - } ; - - PossNP cn np = { - s = \\a,n,c => cn.s ! a ! n ! c ++ np.s ! NPP CVonDat ; - g = cn.g - } ; + ApposCN cn np = let g = cn.g in cn ** { + s = \\a,n,c => cn.s ! a ! n ! c ++ np.s ! NPC c ++ bigNP np } ; + PossNP cn np = cn ** { + s = \\a,n,c => cn.s ! a ! n ! c ++ np.s ! NPP CVonDat } ; } diff --git a/lib/src/german/ParadigmsGer.gf b/lib/src/german/ParadigmsGer.gf index 12b6a9102..66e378d6b 100644 --- a/lib/src/german/ParadigmsGer.gf +++ b/lib/src/german/ParadigmsGer.gf @@ -119,7 +119,6 @@ mkN : overload { mkN3 : N -> Prep -> Prep -> N3 ; -- noun + two prepositions - --3 Proper names and noun phrases -- -- Proper names, with an "s" genitive and other cases like the @@ -127,15 +126,15 @@ mkN : overload { -- taken into account. mkPN : overload { - mkPN : Str -> PN ; -- regular name with genitive in "s" + mkPN : Str -> Gender -> PN ; -- regular name with genitive in "s" -- If only the genitive differs, two strings are needed. - mkPN : (nom,gen : Str) -> PN ; -- name with other genitive + mkPN : (nom,gen : Str) -> Gender -> PN ; -- name with other genitive -- In the worst case, all four forms are needed. - mkPN : (nom,acc,dat,gen : Str) -> PN ; -- name with all case forms + mkPN : (nom,acc,dat,gen : Str) -> Gender -> PN ; -- name with all case forms -- Inflection can also be inherited from the singular forms of a common noun. @@ -145,6 +144,8 @@ mkN : overload { + + --2 Adjectives mkA : overload { @@ -454,21 +455,22 @@ mkV2 : overload { mkN3 = \n,p,q -> n ** {c2 = p ; c3 = q ; lock_N3 = <>} ; - mk2PN = \karolus, karoli -> - {s = table {Gen => karoli ; _ => karolus} ; lock_PN = <>} ; - regPN = \horst -> - mk2PN horst (ifTok Tok (Predef.dp 1 horst) "s" horst (horst + "s")) ; + mk2PN = \karolus, karoli, g -> + {s = table {Gen => karoli ; _ => karolus} ; g = g ; lock_PN = <>} ; + regPN = \horst, g -> + mk2PN horst (ifTok Tok (Predef.dp 1 horst) "s" horst (horst + "s")) g ; mkPN = overload { - mkPN : Str -> PN = regPN ; - mkPN : N -> PN = \n -> lin PN {s = n.s ! Sg} ; - mkPN : (nom,gen : Str) -> PN = mk2PN ; - mkPN : (nom,acc,dat,gen : Str) -> PN = \nom,acc,dat,gen -> - {s = table {Nom => nom ; Acc => acc ; Dat => dat ; Gen => gen} ; lock_PN = <>} + mkPN : Str -> Gender -> PN = regPN ; + mkPN : N -> PN = \n -> lin PN {s = n.s ! Sg; g = n.g} ; + mkPN : (nom,gen : Str) -> Gender -> PN = mk2PN ; + mkPN : (nom,acc,dat,gen : Str) -> Gender -> PN = \nom,acc,dat,gen,g -> + {s = table {Nom => nom ; Acc => acc ; Dat => dat ; Gen => gen} ; + g = g ; lock_PN = <>} } ; - mk2PN : (karolus, karoli : Str) -> PN ; -- karolus, karoli - regPN : (Johann : Str) -> PN ; + mk2PN : (karolus, karoli : Str) -> Gender -> PN ; -- karolus, karoli + regPN : (Johann : Str) -> Gender -> PN ; -- Johann, Johanns ; Johannes, Johannes @@ -553,22 +555,17 @@ mkV2 : overload { seinV v = v ** {aux = VSein} ; reflV v c = v ** {aux = VHaben ; vtype = VRefl (prepC c).c} ; - no_geV v = let vs = v.s in { + no_geV v = let vs = v.s in v ** { s = table { p@(VPastPart _) => Predef.drop 2 (vs ! p) ; - p => vs ! p - } ; - prefix = v.prefix ; particle = v.particle ; lock_V = v.lock_V ; aux = v.aux ; vtype = v.vtype - } ; + p => vs ! p }}; - fixprefixV s v = let vs = v.s in { + fixprefixV s v = let vs = v.s in v ** { s = table { VInf True => "zu" ++ (s + vs ! VInf False) ; p@(VPastPart _) => s + Predef.drop 2 (vs ! p) ; p => s + vs ! p - } ; - prefix = v.prefix ; particle = v.particle ; lock_V = v.lock_V ; aux = v.aux ; vtype = v.vtype - } ; + }} ; haben_V = MorphoGer.haben_V ** {particle = [] ; lock_V = <>} ; sein_V = MorphoGer.sein_V ** {particle = [] ; lock_V = <>} ; diff --git a/lib/src/german/QuestionGer.gf b/lib/src/german/QuestionGer.gf index 667362766..deb2ee2d5 100644 --- a/lib/src/german/QuestionGer.gf +++ b/lib/src/german/QuestionGer.gf @@ -49,7 +49,7 @@ concrete QuestionGer of Question = CatGer ** open ResGer in { QuestIComp icomp np = { s = \\m,t,a,p => let - vp = predV sein_V ; + vp = predV sein_V ** {ext = icomp.ext}; cls = (mkClause (np.s ! NPC Nom) np.a vp).s ! m ! t ! a ! p ; why = icomp.s ! np.a in table { @@ -95,9 +95,9 @@ concrete QuestionGer of Question = CatGer ** open ResGer in { AdvIAdv i a = {s = i.s ++ a.s} ; - CompIAdv a = {s = \\_ => a.s} ; + CompIAdv a = {s = \\_ => a.s ; ext = ""} ; - CompIP ip = {s = \\_ => ip.s ! Nom} ; + CompIP ip = {s = \\_ => ip.s ! Nom ; ext = "" } ; } diff --git a/lib/src/german/ResGer.gf b/lib/src/german/ResGer.gf index 870d59d81..23d9cc612 100644 --- a/lib/src/german/ResGer.gf +++ b/lib/src/german/ResGer.gf @@ -14,6 +14,10 @@ resource ResGer = ParamX ** open Prelude in { flags optimize=all ; coding=utf8 ; +-------------------------------------------- +--PARAMETERS DEFINITIONS +-------------------------------------------- + --2 For $Noun$ -- These are the standard four-value case and three-value gender. @@ -42,6 +46,7 @@ resource ResGer = ParamX ** open Prelude in { oper NPNom : PCase = NPC Nom ; + PrepNom : Preposition = {s,s2 = "" ; isPrep = False ; c = NPNom} ; prepC : PCase -> {s : Str ; c : Case} = \cp -> case cp of { NPC c => {s = [] ; c = c} ; NPP CAnDat => {s = "an" ; c = Dat} ; @@ -196,6 +201,10 @@ resource ResGer = ParamX ** open Prelude in { p = conjPerson (personAgr a) (personAgr b) } ; +-------------------------------------------- +--TYPE DEFINITIONS + WORST-CASE CONSTRUCTORS +-------------------------------------------- + -- For $Lex$. -- For conciseness and abstraction, we first define a method for @@ -228,6 +237,14 @@ resource ResGer = ParamX ** open Prelude in { g : Gender } ; + NP : Type = { + s : PCase => Str ; + rc : Str ; -- die Frage , [rc die ich gestellt habe] + ext : Str ; -- die Frage , [sc wo sie schläft]) + adv : Str ; -- die Frage [a von Max] + a : Agr ; + isPron : Bool } ; + mkN : (x1,_,_,_,_,x6,x7 : Str) -> Gender -> Noun = \Mann, Mannen, Manne, Mannes, Maenner, Maennern, Mann_, g -> { s = table { @@ -265,10 +282,11 @@ resource ResGer = ParamX ** open Prelude in { Adjective : Type = {s : Degree => AForm => Str} ; mkA : (x1,_,_,x4 : Str) -> Adjective = \gut,gute,besser,best -> + let besten = best + "en" in {s = table { Posit => adjForms gut gute ; Compar => adjForms besser besser ; - Superl => adjForms best best + Superl => adjForms ("am" ++ besten) best } } ; @@ -387,6 +405,13 @@ resource ResGer = ParamX ** open Prelude in { appPrep : Preposition -> (PCase => Str) -> Str = \prep,arg -> prep.s ++ arg ! prep.c ++ prep.s2 ; + appPrepNP : Preposition -> NP -> Str = \prep,np -> + prep.s ++ np.s ! prep.c ++ bigNP np ++ prep.s2 ; + -- revised appPrep for discontinuous NPs + + bigNP : NP -> Str = \np -> + np.adv ++ np.ext ++ np.rc ; + -- To build a preposition from just a case. noPreposition : Case -> Preposition = \c -> @@ -469,6 +494,10 @@ resource ResGer = ParamX ** open Prelude in { caselist (teur+"e") (teur+"e") (teur+"en") (teur+"er") ! c } ; +-------------------------------------------- +--VP CONSTRUCTION +-------------------------------------------- + -- For $Verb$. VPC : Type = { @@ -478,15 +507,17 @@ resource ResGer = ParamX ** open Prelude in { } } ; - VP : Type = { + VP : Type = { s : Verb ; - a1 : Polarity => Str ; -- nicht nn : Agr => Str * Str ; -- dich/deine Frau - a2 : Str ; -- heute + a1 : Polarity => Str ; -- nicht = adV + a2 : Str ; -- heute = adv + adj : Str ; -- space for adjectival complements ("ich finde dich schön") isAux : Bool ; -- is a double infinitive inf : Str ; -- sagen ext : Str ; -- dass sie kommt - infExt : Str + infExt : Str ; -- infinitival complements of inf e.g. ich hoffe [zu gehen] zu versuchen + subjc : Preposition -- determines case of "subj" } ; predV : Verb -> VP = predVGen False ; @@ -556,13 +587,14 @@ resource ResGer = ParamX ** open Prelude in { } ; a1 : Polarity => Str = negation ; + a2 : Str = [] ; nn : Agr => Str * Str = case verb.vtype of { VAct => \\_ => <[],[]> ; VRefl c => \\a => } ; - a2 : Str = [] ; isAux = isAux ; ---- - inf,ext,infExt : Str = [] + inf,ext,infExt,adj : Str = [] ; + subjc = PrepNom } ; auxPerfect : Verb -> VForm => Str = \verb -> @@ -612,7 +644,7 @@ resource ResGer = ParamX ** open Prelude in { prefix = [] ; particle = [] ; aux = VSein ; - vtype = VAct + vtype = VAct } ; auxVV : Verb -> Verb ** {isAux : Bool} = \v -> v ** {isAux = True} ; @@ -628,21 +660,13 @@ resource ResGer = ParamX ** open Prelude in { insertObj : (Agr => Str) -> VP -> VP = insertObjNP False ; - insertObjNP : Bool -> (Agr => Str) -> VP -> VP = \isPron, obj,vp -> { - s = vp.s ; - a1 = vp.a1 ; + insertObjNP : Bool -> (Agr => Str) -> VP -> VP = \isPron, obj,vp -> vp ** { nn = \\a => let vpnn = vp.nn ! a in case isPron of { True => ; False => < vpnn.p1, obj ! a ++ vpnn.p2> - } ; - a2 = vp.a2 ; - isAux = vp.isAux ; - inf = vp.inf ; - ext = vp.ext ; - infExt = vp.infExt - } ; + }} ; isLightComplement : Bool -> Preposition -> Bool = \isPron,prep -> case isPron of { False => False ; @@ -652,60 +676,31 @@ resource ResGer = ParamX ** open Prelude in { } } ; - insertAdV : Str -> VP -> VP = \adv,vp -> { - s = vp.s ; - a1 = \\a => adv ++ vp.a1 ! a ; -- immer nicht - nn = vp.nn ; - a2 = vp.a2 ; - isAux = vp.isAux ; - inf = vp.inf ; - ext = vp.ext ; - infExt = vp.infExt - } ; + insertAdV : Str -> VP -> VP = \adv,vp -> vp ** { + a1 = \\a => adv ++ vp.a1 ! a } ; -- immer nicht - insertAdv : Str -> VP -> VP = \adv,vp -> { - s = vp.s ; - a1 = vp.a1 ; - nn = vp.nn ; - a2 = vp.a2 ++ adv ; - isAux = vp.isAux ; - inf = vp.inf ; - ext = vp.ext ; - infExt = vp.infExt - } ; + insertAdv : Str -> VP -> VP = \adv,vp -> vp ** { + a2 = vp.a2 ++ adv } ; - insertExtrapos : Str -> VP -> VP = \ext,vp -> { - s = vp.s ; - a1 = vp.a1 ; - nn = vp.nn ; - a2 = vp.a2 ; - isAux = vp.isAux ; - inf = vp.inf ; - ext = vp.ext ++ ext ; - infExt = vp.infExt - } ; + insertExtrapos : Str -> VP -> VP = \ext,vp -> vp ** { + ext = vp.ext ++ ext } ; - insertInfExt : Str -> VP -> VP = \infExt,vp -> { - s = vp.s ; - a1 = vp.a1 ; - nn = vp.nn ; - a2 = vp.a2 ; - isAux = vp.isAux ; - inf = vp.inf ; - ext = vp.ext ; - infExt = vp.infExt ++ infExt - } ; + insertInfExt : Str -> VP -> VP = \infExt,vp -> vp ** { + infExt = vp.infExt ++ infExt } ; - insertInf : Str -> VP -> VP = \inf,vp -> { - s = vp.s ; - a1 = vp.a1 ; - nn = vp.nn ; - a2 = vp.a2 ; - isAux = vp.isAux ; ---- - inf = inf ++ vp.inf ; - ext = vp.ext ; - infExt = vp.infExt - } ; + insertInf : Str -> VP -> VP = \inf,vp -> vp ** { + inf = inf ++ vp.inf } ; + + insertAdj : Str -> Str * Str -> Str -> VP -> VP = \adj,c,ext,vp -> vp ** { + nn = \\a => + let vpnn = vp.nn ! a in + ; + adj = vp.adj ++ adj ++ c.p2 ; + ext = vp.ext ++ ext} ; + +-------------------------------------------- +--CLAUSE CONSTRUCTION +-------------------------------------------- -- For $Sentence$. @@ -713,7 +708,6 @@ resource ResGer = ParamX ** open Prelude in { s : Mood => Tense => Anteriority => Polarity => Order => Str } ; - mkClause : Str -> Agr -> VP -> Clause = \subj,agr,vp -> let vps = useVP vp in { s = \\m,t,a,b,o => let @@ -725,8 +719,8 @@ resource ResGer = ParamX ** open Prelude in { neg = vp.a1 ! b ; obj0 = (vp.nn ! agr).p1 ; obj = (vp.nn ! agr).p2 ; - compl = obj0 ++ neg ++ obj ++ vp.a2 ; -- from EG 15/5 - inf = vp.inf ++ verb.inf ; + 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 of { @@ -735,12 +729,9 @@ resource ResGer = ParamX ** open Prelude in { } in case o of { - Main => subj ++ verb.fin ++ compl ++ vp.infExt ++ inf ++ extra ; - Inv => verb.fin ++ subj ++ compl ++ vp.infExt ++ inf ++ extra ; + Main => subj ++ verb.fin ++ compl ++ vp.infExt ++ verb.inf ++ extra ++ vp.inf ; + Inv => verb.fin ++ subj ++ compl ++ vp.infExt ++ verb.inf ++ extra ++ vp.inf ; Sub => subj ++ compl ++ vp.infExt ++ inffin ++ extra - -- Main => subj ++ verb.fin ++ compl ++ "[N]" ++ vp.infExt ++ "[/N]" ++ "[I]" ++ inf ++ "[/I]" ++ "[E]" ++ extra ++ "[/E]" ; - -- Inv => verb.fin ++ subj ++ compl ++ inf ++ extra ; - -- Sub => subj ++ compl ++ "(n)" ++ vp.infExt ++ "(/n)" ++ "(if)" ++ inffin ++ "(/if)" ++ "(e)" ++ extra ++ "(/e)" } } ; @@ -798,10 +789,11 @@ resource ResGer = ParamX ** open Prelude in { infPart : Bool -> Str = \b -> if_then_Str b [] "zu" ; heavyNP : - {s : PCase => Str ; a : Agr} -> {s : PCase => Str ; a : Agr ; isPron : Bool} = \np -> - np ** {isPron = False} ; + {s : PCase => Str ; a : Agr} -> {s : PCase => Str ; a : Agr ; isPron : Bool ; adv,ext,rc : Str} = \np -> + np ** {isPron = False; adv,ext,rc = []} ; -- this could be wrong oper + relPron : RelGenNum => Case => Str = \\rgn,c => case rgn of { RGenNum gn => @@ -815,4 +807,14 @@ resource ResGer = ParamX ** open Prelude in { RSentence => "was" } ; +-- Function that allows the construction of non-nominative subjects. + mkSubj : NP -> Preposition -> Str * Agr = \np, subjc -> + let + sub = subjc ; + agr = case sub.c of { + NPC Nom => np.a ; + _ => Ag Masc Sg P3 } ; + subj = appPrepNP sub np + in ; + } diff --git a/lib/src/german/SentenceGer.gf b/lib/src/german/SentenceGer.gf index 2cc36edad..cf255a315 100644 --- a/lib/src/german/SentenceGer.gf +++ b/lib/src/german/SentenceGer.gf @@ -4,7 +4,16 @@ concrete SentenceGer of Sentence = CatGer ** open ResGer, Prelude in { lin - PredVP np vp = mkClause (np.s ! NPC Nom) np.a vp ; + PredVP np vp = + let subj = mkSubj np vp.subjc + in mkClause subj.p1 subj.p2 vp ; + + {- applies verb's subject case to subject ; + forces 3rd person sg agreement for any non-nom subjects --> + "uns graut" "*uns grauen" + allows pre/post-positions in subjects --> + "nach mir wurde gedürstet" "*mir wurde gedürstet" + can't think of case of postpositions in subject -} PredSCVP sc vp = mkClause sc.s (agrP3 Sg) vp ; @@ -21,13 +30,11 @@ concrete SentenceGer of Sentence = CatGer ** open ResGer, Prelude in { in verb.fin ++ ps.p2 ++ (vp.nn ! agr).p1 ++ vp.a1 ! pol ++ (vp.nn ! agr).p2 ++ vp.a2 ++ inf ++ vp.ext - } ; + } ; SlashVP np vp = - mkClause - (np.s ! NPC Nom) np.a - vp ** - {c2 = vp.c2} ; + let subj = mkSubj np vp.subjc + in mkClause subj.p1 subj.p2 vp ** {c2 = vp.c2} ; AdvSlash slash adv = { s = \\m,t,a,b,o => slash.s ! m ! t ! a ! b ! o ++ adv.s ; @@ -36,10 +43,11 @@ concrete SentenceGer of Sentence = CatGer ** open ResGer, Prelude in { SlashPrep cl prep = cl ** {c2 = prep} ; - SlashVS np vs slash = - mkClause (np.s ! NPC Nom) np.a - (insertExtrapos (conjThat ++ slash.s ! Sub) (predV vs)) ** - {c2 = slash.c2} ; + SlashVS np vs slash = + let subj = mkSubj np PrepNom + in mkClause subj.p1 subj.p2 + (insertExtrapos (conjThat ++ slash.s ! Sub) (predV vs)) ** + {c2 = slash.c2} ; EmbedS s = {s = conjThat ++ s.s ! Sub} ; EmbedQS qs = {s = qs.s ! QIndir} ; @@ -66,6 +74,7 @@ concrete SentenceGer of Sentence = CatGer ** open ResGer, Prelude in { SSubjS a s b = {s = \\o => a.s ! o ++ "," ++ s.s ++ b.s ! Sub} ; - RelS s r = {s = \\o => s.s ! o ++ "," ++ r.s ! RSentence} ; --- "welches" + RelS s r = {s = \\o => s.s ! o ++ "," ++ r.s ! RSentence} ; --- "was" + } diff --git a/lib/src/german/StructuralGer.gf b/lib/src/german/StructuralGer.gf index 4a2b6c736..881507e35 100644 --- a/lib/src/german/StructuralGer.gf +++ b/lib/src/german/StructuralGer.gf @@ -19,7 +19,7 @@ concrete StructuralGer of Structural = CatGer ** before_Prep = mkPrep "vor" P.dative ; behind_Prep = mkPrep "hinter" P.dative ; between_Prep = mkPrep "zwischen" P.dative ; - both7and_DConj = sd2 "sowohl" ["als auch"] ** {n = Pl} ; + both7and_DConj = sd2 "sowohl" ["als auch"] ** {n = Sg} ; but_PConj = ss "aber" ; by8agent_Prep = mkPrep "durch" P.accusative ; by8means_Prep = mkPrep "mit" P.dative ; @@ -29,7 +29,7 @@ concrete StructuralGer of Structural = CatGer ** "konnte" "konntest" "konnten" "konntet" "könnte" "gekonnt" [] VHaben) ; - during_Prep = mkPrep "während" P.genitive ; + during_Prep = mkPrep "während" P.genitive | P.mkPrep P.accusative "über" ; either7or_DConj = sd2 "entweder" "oder" ** {n = Sg} ; everybody_NP = nameNounPhrase {s = caselist "jeder" "jeden" "jedem" "jedes"} ; every_Det = detLikeAdj False Sg "jed" ; @@ -46,7 +46,7 @@ concrete StructuralGer of Structural = CatGer ** how_IAdv = ss "wie" ; how8much_IAdv = ss "wieviel" ; how8many_IDet = {s = \\g,c => (detLikeAdj False Pl "wie viel").s ! g ! NPC c ; n = Pl} ; - if_Subj = ss "wenn" ; + if_Subj = ss "wenn" | ss "falls" ; in8front_Prep = mkPrep "vor" P.dative ; i_Pron = mkPronPers "ich" "mich" "mir" "meiner" "mein" Masc Sg P1 ; in_Prep = mkPrep [] (NPP CInDat) ; @@ -91,7 +91,7 @@ concrete StructuralGer of Structural = CatGer ** jener : Number => Gender => PCase => Str = \\n => (detLikeAdj True n "jen").s in {s,sp = \\_ => jener ; a,aPl = Weak} ; ---b that_NP = nameNounPhrase {s = caselist "das" "das" "denem" "dessen"} ; ---- - there_Adv = ss "da" ; + there_Adv = ss "da" | ss "dort" ; there7to_Adv = ss "dahin" ; there7from_Adv = ss ["daher"] ; therefore_PConj = ss "deshalb" ; @@ -145,7 +145,7 @@ concrete StructuralGer of Structural = CatGer ** nobody_NP = nameNounPhrase {s = caselist "niemand" "niemanden" "niemandem" "niemands"} ; nothing_NP = - nameNounPhrase {s = \\_ => "nichts"} ; + nameNounPhrase {s = \\_ => "nichts"} ; --maybe add: nameNounPhrase {s = \\_ => "garnichts"} at_least_AdN = ss "wenigstens" ; at_most_AdN = ss "höchstens" ; except_Prep = mkPrep "außer" P.dative ; diff --git a/lib/src/german/SymbolGer.gf b/lib/src/german/SymbolGer.gf index 204e4b936..4782d14f0 100644 --- a/lib/src/german/SymbolGer.gf +++ b/lib/src/german/SymbolGer.gf @@ -11,18 +11,21 @@ lin CNIntNP cn i = { s = \\c => cn.s ! Weak ! Sg ! Nom ++ i.s ; a = agrP3 Sg ; - isPron = False + isPron = False ; + ext,rc,adv = [] -- added } ; CNSymbNP det cn xs = let g = cn.g in { s = \\c => det.s ! g ! c ++ (let k = (prepC c).c in cn.s ! adjfCase det.a k ! det.n ! k) ++ xs.s ; a = agrP3 det.n ; - isPron = False + isPron = False ; + ext,rc,adv = [] -- added } ; CNNumNP cn i = { s = \\c => artDefContr (GSg cn.g) c ++ cn.s ! Weak ! Sg ! Nom ++ i.s ! Neutr ! (prepC c).c ; a = agrP3 Sg ; - isPron = False + isPron = False ; + ext,rc,adv = [] -- added } ; SymbS sy = {s = \\_ => sy.s} ; diff --git a/lib/src/german/VerbGer.gf b/lib/src/german/VerbGer.gf index f86e72869..0efc30df4 100644 --- a/lib/src/german/VerbGer.gf +++ b/lib/src/german/VerbGer.gf @@ -19,14 +19,14 @@ concrete VerbGer of Verb = CatGer ** open Prelude, ResGer, Coordination in { insertExtrapos (comma ++ conjThat ++ s.s ! Sub) (predV v) ; ComplVQ v q = insertExtrapos (comma ++ q.s ! QIndir) (predV v) ; - ComplVA v ap = insertObj (\\ _ => ap.s ! APred) (predV v) ; + ComplVA v ap = insertAdj (ap.s ! APred) ap.c ap.ext (predV v) ; -- changed SlashV2a v = predV v ** {c2 = v.c2} ; Slash2V3 v np = - insertObj (\\_ => appPrep v.c2 np.s) (predV v) ** {c2 = v.c3} ; + insertObj (\\_ => appPrepNP v.c2 np) (predV v) ** {c2 = v.c3} ; Slash3V3 v np = - insertObj (\\_ => appPrep v.c3 np.s) (predV v) ** {c2 = v.c2} ; + insertObj (\\_ => appPrepNP v.c3 np) (predV v) ** {c2 = v.c2} ; SlashV2S v s = insertExtrapos (conjThat ++ s.s ! Sub) (predV v) ** {c2 = v.c2} ; @@ -41,9 +41,9 @@ concrete VerbGer of Verb = CatGer ** open Prelude, ResGer, Coordination in { insertObj vpi.p1 ((predVGen v.isAux v)))) ** {c2 = v.c2} ; SlashV2A v ap = - insertObj (\\_ => ap.s ! APred) (predV v) ** {c2 = v.c2} ; + insertAdj (ap.s ! APred) ap.c ap.ext (predV v) ** {c2 = v.c2} ; -- changed - ComplSlash vp np = insertObjNP (isLightComplement np.isPron vp.c2) (\\_ => appPrep vp.c2 np.s) vp ; + ComplSlash vp np = insertObjNP (isLightComplement np.isPron vp.c2) (\\_ => appPrepNP vp.c2 np) vp ; SlashVV v vp = let @@ -61,21 +61,24 @@ concrete VerbGer of Verb = CatGer ** open Prelude, ResGer, Coordination in { insertExtrapos vpi.p3 ( insertInf vpi.p2 ( insertObj vpi.p1 ( - insertObj (\\_ => appPrep v.c2 np.s) ( + insertObj (\\_ => appPrepNP v.c2 np) ( predVGen v.isAux v)))) ** {c2 = v.c2} ; UseComp comp = insertObj comp.s (predV sein_V) ; -- agr not used - -- we want to say "ich liebe sie nicht" but not "ich bin alt nicht" + -- adj slot not used here for e.g. "ich bin alt" but same behaviour as NPs? + -- "ich bin nicht alt" "ich bin nicht Doris" + UseCopula = predV sein_V ; - CompAP ap = {s = \\_ => ap.s ! APred} ; - CompNP np = {s = \\_ => np.s ! NPC Nom} ; - CompAdv a = {s = \\_ => a.s} ; + CompAP ap = {s = \\_ => ap.c.p1 ++ ap.s ! APred ++ ap.c.p2 ; ext = ap.ext} ; + CompNP np = {s = \\_ => np.s ! NPC Nom ++ np.adv ++ np.rc ; ext = np.ext} ; + CompAdv a = {s = \\_ => a.s ; ext = []} ; CompCN cn = {s = \\a => case numberAgr a of { Sg => "ein" + pronEnding ! GSg cn.g ! Nom ++ cn.s ! Strong ! Sg ! Nom ; Pl => cn.s ! Strong ! Pl ! Nom - } + } ; + ext = [] } ; AdvVP vp adv = insertAdv adv.s vp ;