diff --git a/src/german/ConstructionGer.gf b/src/german/ConstructionGer.gf index 27f53f62..ab90fade 100644 --- a/src/german/ConstructionGer.gf +++ b/src/german/ConstructionGer.gf @@ -36,7 +36,7 @@ lin bottle_of_CN np = N.ApposCN (mkCN (mkN "Flasche")) np ; cup_of_CN np = N.ApposCN (mkCN (mkN "Tasse")) np ; - glass_of_CN np = N.ApposCN (mkCN (mkN "Glas")) np ; + glass_of_CN np = N.ApposCN (mkCN (mkN "Glas" "Gläser" neuter)) np ; -- spatial deixis and motion verbs where_go_QCl np = mkQCl (lin IAdv (ss "wohin")) (mkCl np (mkVP L.go_V)) ; diff --git a/src/german/DictGer.gf b/src/german/DictGer.gf index be37e7e1..74019199 100644 --- a/src/german/DictGer.gf +++ b/src/german/DictGer.gf @@ -15315,6 +15315,7 @@ lin glans_N = mkN "Glans" "Glandes" feminine ; glanzleistung_N = mkN "Glanzleistung" ; glaren_V = regV "glaren" ; + glas_N = mkN "Glas" "Gläser" neuter ; glasampulle_N = mkN "Glasampulle" "Glasampullen" feminine ; glasauge_N = mkN "Glasauge" "Glasaugen" neuter ; glasbaustein_N = mkN "Glasbaustein" "Glasbausteine" masculine ; diff --git a/src/german/DictGerAbs.gf b/src/german/DictGerAbs.gf index d2f5e3ed..479bd23d 100644 --- a/src/german/DictGerAbs.gf +++ b/src/german/DictGerAbs.gf @@ -15313,6 +15313,7 @@ fun glans_N : N ; glanzleistung_N : N ; glaren_V : V ; + glas_N : N ; glasampulle_N : N ; glasauge_N : N ; glasbaustein_N : N ; diff --git a/src/german/ExtraGer.gf b/src/german/ExtraGer.gf index df1906d0..84813916 100644 --- a/src/german/ExtraGer.gf +++ b/src/german/ExtraGer.gf @@ -1,5 +1,5 @@ concrete ExtraGer of ExtraGerAbs = CatGer ** - open ResGer, Coordination, Prelude, IrregGer, (P = ParadigmsGer) in { + open ResGer, Coordination, Prelude, IrregGer, (P = ParadigmsGer), (N = NounGer) in { flags coding=utf8 ; lincat @@ -34,15 +34,15 @@ concrete ExtraGer of ExtraGerAbs = CatGer ** IAdvAdv adv = {s = "wie" ++ adv.s} ; DetNPMasc det = { - s = \\c => det.sp ! Masc ! c ; ---- genders - a = agrP3 det.n ; + s = \\c => det.sp ! Masc ! c ; + a = agrgP3 Masc det.n ; w = WLight ; ext, rc = [] } ; DetNPFem det = { - s = \\c => det.sp ! Fem ! c ; ---- genders - a = agrP3 det.n ; + s = \\c => det.sp ! Fem ! c ; + a = agrgP3 Fem det.n ; w = WLight ; ext, rc = [] } ; @@ -55,12 +55,8 @@ concrete ExtraGer of ExtraGerAbs = CatGer ** } ; PassVPSlash vp = - let c = case of { - => 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 + insertObj (\\_ => (PastPartAP vp).s ! APred) (predV werdenPass) ** + { c1 = subjPrep vp.c2 } ; -- this also gives "mit dir wird gerechnet" ; -- the alternative linearisation ("es wird mit dir gerechnet") is not implemented @@ -68,13 +64,13 @@ concrete ExtraGer of ExtraGerAbs = CatGer ** 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) ** + let bekommen : Verb = P.habenV (P.irregV "bekommen" "bekommt" "bekam" "bekäme" "bekommen") + in insertObj (\\_ => (v.s ! VPastPart APred)) (predV bekommen) ** { c1 = PrepNom ; c2 = v.c2 ; objCtrl = False } ; PastPartAP vp = let a = agrP3 Sg in { - s = \\af => (vp.nn ! a).p1 ++ (vp.nn ! a).p2 ++ (vp.nn ! a).p3 ++ vp.a2 + s = \\af => (vp.nn ! a).p1 ++ (vp.nn ! a).p2 ++ (vp.nn ! a).p3 ++ vp.a2 ++ vp.adj ++ vp.inf.inpl.p2 ++ (vp.inf.extr ! a) ++ vp.s.s ! VPastPart af ; isPre = True ; c = <[],[]> ; @@ -86,7 +82,7 @@ concrete ExtraGer of ExtraGerAbs = CatGer ** 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.a2 ++ agent ++ vp.adj ++ vp.inf.inpl.p2 ++ vp.c2.s -- junk if not TV ++ vp.ext ++ (vp.inf.extr ! a) ++ vp.s.s ! VPastPart af ; isPre = True ; @@ -128,7 +124,7 @@ concrete ExtraGer of ExtraGerAbs = CatGer ** a = tm.a ; t = tm.t ; m = tm.m ; - subj = [] ; + subj = [] ++ tm.s ++ p.s ; 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 ; @@ -174,24 +170,93 @@ concrete ExtraGer of ExtraGerAbs = CatGer ** ConjVPS = conjunctDistrTable2 Order Agr ; +-- Reflexive noun phrases -- (HL 5/2022: improved and completed, RNPList added) + lincat - RNP = {s : Agr => Case => Str} ; + RNP = {s : Agr => Case => Str ; rc,ext : Str ; isPron : Bool} ; + RNPList = {s1,s2 : Agr => Case => Str} ; + + linref + RNP = \rnp -> rnp.s ! (Ag Masc Sg P3) ! Acc ++ rnp.ext ++ rnp.rc ; + lin ReflRNP vps rnp = - insertObj (\\a => appPrep vps.c2 - (\\k => usePrepC k (\c -> rnp.s ! a ! c))) vps ; + insertObjReflNP vps rnp ; - 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 = { -- personal pronoun, with "sich" in P3 Sg + s = ResGer.reflPron ; rc,ext = [] ; isPron = True } ; - 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 + -- We might define ReflPron by the stronger reflPronSelf below, using "selbst" + -- to distinguish personal pronoun from reflexive pronoun: -- 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: + + ReflPoss num cn = + {s = \\a,c => let adjf = case num.n of {Sg => Strong ; Pl => Weak} -- Duden 477, HL 5/2022 + in possPron a num.n cn.g c ++ num.s ! cn.g ! c -- HL 5/2022: meine wenigstens 3 cn, + ++ cn.s ! adjfCase adjf c ! num.n ! c -- not: wenigstens 3 meine cn + ++ cn.adv ; + ext = cn.ext ; rc = cn.rc ! num.n ; + isPron = False} ; + + -- We might define ReflPoss by the stronger reflPossPron below, using "eigen(er)" + -- to distinguish possessive pronoun from reflexive possessive pronoun: -- du kennst meine Fehler vs. ich kenne meine eigenen Fehler -- er|sie|es kennt seine|ihre Fehler vs. er|sie|es kennt seine|ihre|seine eigenen Fehler + + PredetRNP pred rnp = rnp ** { -- HL 5/2022 + s = \\a,c => let n = case pred.a of {PAg n => n ; _ => numberAgr a} ; + g = genderAgr a ; + d = case pred.c.k of {NoCase => c ; PredCase k => (prepC k).c} ; + in case rnp.isPron of { + True => pred.s ! Pl ! Masc ! (NPC c) ++ "von" ++ rnp.s ! a ! Dat ; + _ => pred.s ! n ! genderAgr a ! (NPC c) ++ pred.c.p ++ rnp.s ! a ! d} ; + ext = rnp.ext ; rc = rnp.rc ; + isPron = False} ; + -- ok: alle von uns; die meisten von uns ; wrong: *nur von uns =/= nur wir + + AdvRNP np prep rnp = {s = \\a,c => np.s ! (NPC c) + ++ appPrepC prep (rnp.s ! a) ++ rnp.ext ++ rnp.rc ; + ext = np.ext ; rc = np.rc ; isPron = False} ; + + AdvRAP ap prep rnp = + let -- ? adv ++ ap.s ! af + adv = appPrepC prep (rnp.s ! agrP3 Sg) ; -- bug: fixed agreement + in ap ** { s = \\af => ap.s ! af ++ adv } ; -- e.g. unknown in one's youth + + ReflA2RNP adj rnp = -- would need AP.c : Agr => Str*Str, not AP.c : Str*Str + let -- as we have no reflexive AP, + compl = appPrepC adj.c2 (rnp.s ! agrP3 Sg) ; -- we use a fixed agreement + in { + s = adj.s ! Posit ; + isPre = True ; + c = case adj.c2.isPrep of {False => ; True => <[], compl>} ; + ext = rnp.ext ++ rnp.rc + } ; + + PossPronRNP pron num cn rnp = + N.DetCN (N.DetQuant (N.PossPron pron) num) + (N.PossNP cn (lin NP {s = \\pc => usePrepC pc (\c -> rnp.s ! pron.a ! c) ; + a = pron.a ; + w = WLight ; + ext = rnp.ext ; + rc = rnp.rc})) ; + + -- AdvRVP : VP -> Prep -> RNP -> VP not implemented, as the reflexive adverb (Prep + RNP): Agr => Str + -- could only be added to vp.a2:Str with fixed agreement, but can depend on nominal subject or object, + -- e.g. "er spricht mit ihr über sein Kind" vs. "er spricht mit ihr über ihr Kind". + + ConjRNP conj rnps = conjunctDistrTable2 Agr Case conj rnps + ** {isPron = False ; ext,rc = []} ; + + Base_rr_RNP x y = twoTable2 Agr Case x y ; + Base_nr_RNP x y = twoTable2 Agr Case {s = \\_,c => x.s ! (NPC c) ++ x.ext ++ x.rc} y ; + Base_rn_RNP x y = twoTable2 Agr Case x {s = \\_,c => y.s ! (NPC c) ++ y.ext ++ y.rc} ; + + Cons_rr_RNP x xs = consrTable2 Agr Case comma x xs ; + Cons_nr_RNP x xs = consrTable2 Agr Case comma {s = \\_,c => x.s ! (NPC c) ++ x.ext ++ x.rc} xs ; + oper reflPronSelf : Agr => Case => Str = \\a => \\c => reflPron ! a ! c ++ "selbst" ; @@ -199,7 +264,22 @@ concrete ExtraGer of ExtraGerAbs = CatGer ** 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 + insertObjReflNP : ResGer.VPSlash -> RNP -> ResGer.VP = -- HL 5/2022 + \vp,rnp -> -- generalize ResGer.insertObjRefl + let prep = vp.c2 ; + c = case prep.c of { NPC cc => cc ; _ => Acc } ; -- put rnp.ext ++ rnp.rc to vp.ext ? + obj : Agr => Str = \\a => prep.s ++ rnp.s ! a ! c ++ rnp.ext ++ rnp.rc + in vp ** { + nn = \\a => + let vpnn = vp.nn ! a in + case of { -- consider non-pron rnp as light, add to vpnn.p2 + => ; -- pronoun switch: + => ; -- accPron < pron + => ; -- < non-pron nominal + => } -- or prepositional + } ; + +-- SS: implementation of some of the relevant Foc rules from Extra lincat Foc = {s : Mood => ResGer.Tense => Anteriority => Polarity => Str} ; diff --git a/src/german/ExtraGerAbs.gf b/src/german/ExtraGerAbs.gf index eff464de..54c29f61 100644 --- a/src/german/ExtraGerAbs.gf +++ b/src/german/ExtraGerAbs.gf @@ -4,7 +4,9 @@ abstract ExtraGerAbs = Extra [ VPSlash, PassVPSlash, PassAgentVPSlash, CompIQuant, PastPartAP, PastPartAgentAP, Temp,Tense,Pol,S,NP,VV,VP,Conj,IAdv,IQuant,IComp,ICompAP,IAdvAdv,Adv,AP, Foc,FocObj,FocAdv,FocAP,UseFoc, - RNP,ReflRNP,ReflPoss,ReflPron + RNP,ReflRNP,ReflPron,ReflPoss,PredetRNP + ,RNPList,ConjRNP,Base_rr_RNP,Base_nr_RNP,Base_rn_RNP,Cons_rr_RNP,Cons_nr_RNP + ,DetNPMAsc,DetNPFem ] ** { flags coding=utf8; @@ -25,6 +27,16 @@ abstract ExtraGerAbs = Extra [ 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. - Pass3V3 : V3 -> VPSlash ; -- wir bekommen den Beweis erklärt + Pass3V3 : V3 -> VPSlash ; -- wir bekommen den Beweis erklärt + -- further constructions usin RNP, declared in abstract/Extra.gf: + + AdvRNP : NP -> Prep -> RNP -> RNP ; -- a dispute with his wife + AdvRVP : VP -> Prep -> RNP -> VP ; -- lectured about her travels + AdvRAP : AP -> Prep -> RNP -> AP ; -- adamant in his refusal + + ReflA2RNP : A2 -> RNP -> AP ; -- indifferent to their surroundings + -- NOTE: generalizes ReflA2 + + PossPronRNP : Pron -> Num -> CN -> RNP -> NP ; -- his abandonment of his wife and children } diff --git a/src/german/MorphoGer.gf b/src/german/MorphoGer.gf index f7b6a75f..05df5996 100644 --- a/src/german/MorphoGer.gf +++ b/src/german/MorphoGer.gf @@ -20,12 +20,13 @@ oper mkPrep : Str -> PCase -> Preposition = \s,c -> {s = s ; s2 = [] ; c = c ; isPrep = True} ; - nameNounPhrase : {s : Case => Str} -> {s : PCase => Str ; a : Agr ; - -- isLight, isPron : Bool ; - w : Weight ; - ext,rc : Str} = \name -> heavyNP { + nameNounPhrase : Gender -> {s : Case => Str} -> {s : PCase => Str ; + a : Agr ; + w : Weight ; + ext,rc : Str} = + \g,name -> heavyNP { s = \\c => usePrepC c (\k -> name.s ! k) ; - a = agrP3 Sg + a = agrgP3 g Sg } ; detLikeAdj : Bool -> Number -> Str -> diff --git a/src/german/ParadigmsGer.gf b/src/german/ParadigmsGer.gf index 1afd0886..bb0c5f81 100644 --- a/src/german/ParadigmsGer.gf +++ b/src/german/ParadigmsGer.gf @@ -48,7 +48,7 @@ oper dative : Case ; genitive : Case ; - anDat_Case : Case ; -- preposition "an" accusative with contraction "am" --% + anDat_Case : Case ; -- preposition "an" dative with contraction "am" --% inAcc_Case : Case ; -- preposition "in" accusative with contraction "ins" --% inDat_Case : Case ; -- preposition "in" dative with contraction "im" --% zuDat_Case : Case ; -- preposition "zu" dative with contractions "zum", "zur" --% diff --git a/src/german/ParseGer.gf b/src/german/ParseGer.gf index c2e031d3..7f14caef 100644 --- a/src/german/ParseGer.gf +++ b/src/german/ParseGer.gf @@ -26,7 +26,7 @@ open MorphoGer, ResGer, ParadigmsGer, SyntaxGer, Prelude, HTML in { flags literal=Symb ; coding = utf8 ; lin - ComplVV v ant p vp = +{- ComplVV v ant p vp = let vpi = infVP v.isAux vp in @@ -35,6 +35,14 @@ lin insertInf vpi.p2 ( insertObj vpi.p1 ( predVGen v.isAux v)))) ; +-} + ComplVV v ant pol vp = -- HL 4/22 + let + vps = predVGen v.isAux v ; + inf = mkInf v.isAux ant pol vp + in + insertExtrapos vp.ext ( + insertInf inf vps) ; PastPartRS ant pol sl = { -- guessed by KA, some fields in sl are ignored!! s = \\gn => let agr = agrgP3 Masc (numGenNum gn) diff --git a/src/german/ResGer.gf b/src/german/ResGer.gf index cd4da865..20515fdd 100644 --- a/src/german/ResGer.gf +++ b/src/german/ResGer.gf @@ -47,6 +47,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} ; @@ -54,12 +55,15 @@ resource ResGer = ParamX ** open Prelude in { NPP CInDat => {s = "in" ; c = Dat} ; NPP CZuDat => {s = "zu" ; c = Dat} ; NPP CVonDat => {s = "von" ; c = Dat} - } ; usePrepC : PCase -> (Case -> Str) -> Str = \c,fs -> let sc = prepC c in sc.s ++ fs sc.c ; + appPrepC : Preposition -> (Case => Str) -> Str = \prep,arg -> + let sc = prepC prep.c + in prep.s ++ sc.s ++ arg ! sc.c ++ prep.s2 ; + oper mkAgr : {g : Gender ; n : Number ; p : Person} -> Agr = \r -> Ag r.g r.n r.p ; @@ -251,11 +255,8 @@ resource ResGer = ParamX ** open Prelude in { s : PCase => Str ; rc : Str ; -- die Frage , [rc die ich gestellt habe] ext : Str ; -- die Frage , [sc wo sie schläft] ; die Regel , [vp kein Fleisch zu essen] | [s dass ...] - -- adv : Str ; -- die Frage [a von Max] -- HL: cannot be extracted a : Agr ; - -- isLight : Bool ; -- light NPs come before negation in simple clauses (expensive) - -- isPron : Bool ; -- needed to put accPron before datPron - w : Weight } ; + w : Weight } ; -- light NPs come before negation in simple clauses (expensive) mkN : (x1,_,_,_,_,x6,x7 : Str) -> Gender -> Noun = \Mann, Mannen, Manne, Mannes, Maenner, Maennern, Mann_, g -> { @@ -442,6 +443,14 @@ resource ResGer = ParamX ** open Prelude in { noPreposition : Case -> Preposition = \c -> {s,s2 = [] ; c = NPC c ; isPrep = False} ; +-- To build passive: accusative object -> nom subject; others -> same case or prep + + subjPrep : Preposition -> Preposition = \prep -> + case of { + => prep ** {c = NPC Nom} ; + _ => prep + } ; + -- Pronouns and articles -- Here we define personal and relative pronouns. -- All personal pronouns, except "ihr", conform to the simple @@ -990,7 +999,7 @@ resource ResGer = ParamX ** open Prelude in { => "deren" ; _ => artDef ! gn ! c } ; - RSentence => "was" + RSentence => (caselist "was" "was" "was" "wessen") ! c -- wessen HL 4/2022 } ; -- Function that allows the construction of non-nominative subjects. diff --git a/src/german/SentenceGer.gf b/src/german/SentenceGer.gf index cf30c30c..fa622d25 100644 --- a/src/german/SentenceGer.gf +++ b/src/german/SentenceGer.gf @@ -36,7 +36,7 @@ concrete SentenceGer of Sentence = CatGer ** open ResGer, Prelude in { SlashVP np vp = let subj = mkSubj np vp.c1 ; -- HL 3/2022: need a mkClSlash to prevent in mkClause subj.p1 subj.p2 vp ** { c2 = vp.c2 } ; -- reflexives in vp instantiated to np.a - + -- cf. tests/german/TestLangGer.gf AdvSlash slash adv = { s = \\m,t,a,b,o => slash.s ! m ! t ! a ! b ! o ++ adv.s ; c2 = slash.c2 @@ -75,7 +75,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} ; --- "was" + RelS s r = {s = \\o => s.s ! o ++ "," ++ r.s ! RSentence} ; --- "was" } diff --git a/src/german/StructuralGer.gf b/src/german/StructuralGer.gf index 73accdab..043e2674 100644 --- a/src/german/StructuralGer.gf +++ b/src/german/StructuralGer.gf @@ -1,7 +1,7 @@ concrete StructuralGer of Structural = CatGer ** open MorphoGer, MakeStructuralGer, (X = ConstructX), - (P = ParadigmsGer), IrregGer, Prelude in { + (P = ParadigmsGer), IrregGer, Prelude, (R = ResGer) in { flags optimize=all ; coding=utf8 ; @@ -10,7 +10,8 @@ concrete StructuralGer of Structural = CatGer ** above_Prep = mkPrep "über" P.dative ; after_Prep = mkPrep "nach" P.dative ; - all_Predet = {s = appAdj (regA "all") ; c = noCase ; a = PAgNone} ; +-- all_Predet = {s = appAdj (regA "all") ; c = noCase ; a = PAgNone} ; + all_Predet = {s = appAdj (regA "all") ; c = noCase ; a = PAg Pl} ; -- HL 5/2022 almost_AdA, almost_AdN = ss "fast" ; although_Subj = ss "obwohl" ; always_AdV = ss "immer" ; @@ -31,9 +32,9 @@ concrete StructuralGer of Structural = CatGer ** VHaben) ; during_Prep = mkPrep "während" P.genitive ; --- no variants in the rgl | P.mkPrep P.accusative "über" ; either7or_DConj = sd2 "entweder" "oder" ** {n = Sg} ; - everybody_NP = nameNounPhrase {s = caselist "jeder" "jeden" "jedem" "jedes"} ; + everybody_NP = nameNounPhrase Masc {s = caselist "jeder" "jeden" "jedem" "jedes"} ; every_Det = detUnlikeAdj False Sg "jed" ; - everything_NP = nameNounPhrase {s = caselist "alles" "alles" "allem" "alles"} ; + everything_NP = nameNounPhrase Neutr {s = caselist "alles" "alles" "allem" "alles"} ; everywhere_Adv = ss "überall" ; few_Det = detLikeAdj False Pl "wenig" ; ---- first_Ord = {s = (regA "erst").s ! Posit} ; @@ -54,7 +55,15 @@ concrete StructuralGer of Structural = CatGer ** less_CAdv = X.mkCAdv "weniger" "als" ; many_Det = detLikeAdj False Pl "viel" ; more_CAdv = X.mkCAdv "mehr" "als" ; - most_Predet = {s = appAdj (regA "meist") ; c = noCase ; a = PAgNone} ; +-- most_Predet = {s = appAdj (regA "meist") ; c = noCase ; a = PAgNone} ; + most_Predet = { -- HL 5/2022 + s = \\n,g,c => let gn = R.gennum g n ; + k = (R.prepC c).c ; + adj = (P.mkA "viel" "mehr" "meiste").s ! Superl + in + R.usePrepC c (\k -> R.artDef ! gn ! k ++ adj ! (agrAdj g Weak n k)) ; + c = {p = [] ; k = PredCase (NPC Gen)} ; + a = PAg Pl} ; much_Det = {s = \\_,_ => "viel" ; sp = \\_,_ => "vieles" ; n = Sg ; a = Weak ; isDef = False} ; must_VV = auxVV (mkV @@ -75,7 +84,7 @@ concrete StructuralGer of Structural = CatGer ** quite_Adv = ss "ziemlich" ; she_Pron = mkPronPers "sie" "sie" "ihr" "ihrer" "ihr" Fem Sg P3 ; so_AdA = ss "so" ; - somebody_NP = nameNounPhrase {s = caselist "jemand" "jemanden" "jemandem" "jemands"} ; + somebody_NP = nameNounPhrase Masc {s = caselist "jemand" "jemanden" "jemandem" "jemands"} ; somePl_Det = detLikeAdj True Pl "einig" ; someSg_Det = { s,sp = \\g,c => @@ -85,12 +94,12 @@ concrete StructuralGer of Structural = CatGer ** hasNum = True ; isDef = False ; } ; - something_NP = nameNounPhrase {s = \\_ => "etwas"} ; + something_NP = nameNounPhrase Neutr {s = \\_ => "etwas"} ; somewhere_Adv = ss "irgendwo" ; that_Quant = let jener : Number => Gender => PCase => Str = \\n => (detUnlikeAdj True n "jen").s in {s,sp = \\_ => jener ; a,aPl = Weak} ; ----b that_NP = nameNounPhrase {s = caselist "das" "das" "denem" "dessen"} ; ---- +---b that_NP = nameNounPhrase Neutr {s = caselist "das" "das" "dem" "dessen"} ; ---- there_Adv = ss "da" ; --- no variants in the rgl | ss "dort" ; there7to_Adv = ss "dahin" ; there7from_Adv = ss ["daher"] ; @@ -100,7 +109,7 @@ concrete StructuralGer of Structural = CatGer ** this_Quant = let dieser : Number => Gender => PCase => Str = \\n => (detUnlikeAdj True n "dies").s in {s,sp = \\_ => dieser ; a,aPl = Weak} ; ----b this_NP = nameNounPhrase {s = caselist "dies" "dies" "diesem" "dieses"} ; ---- +---b this_NP = nameNounPhrase Neutr {s = caselist "dies" "dies" "diesem" "dieses"} ; ---- ---b those_NP = {s = caselist "jene" "jene" "jenen" "jener" ; a = agrP3 Pl} ; through_Prep = mkPrep "durch" P.accusative ; too_AdA = ss "zu" ; @@ -143,9 +152,9 @@ concrete StructuralGer of Structural = CatGer ** {s,sp = \\_ => keiner ; a = Strong ; aPl = Weak} ; ---- sp if_then_Conj = {s1 = "wenn" ; s2 = "dann" ; n = Sg ; lock_Conj = <>} ; nobody_NP = - nameNounPhrase {s = caselist "niemand" "niemanden" "niemandem" "niemands"} ; + nameNounPhrase Masc {s = caselist "niemand" "niemanden" "niemandem" "niemands"} ; nothing_NP = - nameNounPhrase {s = \\_ => "nichts"} ; --maybe add: nameNounPhrase {s = \\_ => "garnichts"} + nameNounPhrase Neutr {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 ; @@ -156,4 +165,7 @@ concrete StructuralGer of Structural = CatGer ** lin language_title_Utt = ss "Deutsch" ; +oper + appAdjDegAdjf : Adjective -> Degree -> Adjf -> Number => Gender => PCase => Str = + \adj,deg,adjf -> \\n,g,c => R.usePrepC c (\k -> adj.s ! deg ! (agrAdj g adjf n k)) ; } diff --git a/src/german/VerbGer.gf b/src/german/VerbGer.gf index 7a25b1a0..ab153cb9 100644 --- a/src/german/VerbGer.gf +++ b/src/german/VerbGer.gf @@ -129,8 +129,8 @@ concrete VerbGer of Verb = CatGer ** open Prelude, ResGer, Coordination in { UseComp comp = insertExtrapos comp.ext (insertObj comp.s (predV sein_V)) ; -- agr not used - -- adj slot not used here for e.g. "ich bin alt" but same behaviour as NPs? - -- "ich bin nicht alt" "ich bin nicht Doris" + -- SS: 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 ; diff --git a/tests/german/TestLang.gf b/tests/german/TestLang.gf index 107765a8..883dc64c 100644 --- a/tests/german/TestLang.gf +++ b/tests/german/TestLang.gf @@ -1,8 +1,11 @@ abstract TestLang = - Grammar - [SlashVP, RelSlash], + Grammar - [SlashVP, RelSlash, QuestSlash, AdvSlash, SlashPrep, SlashVS, UseSlash], TestLexiconGerAbs , Construction - ** { + , Extend [PassVPSlash,PastPartAP + ,RNP,ReflRNP,ReflPron,ReflPoss,PredetRNP,AdvRNP,ReflA2RNP,PossPronRNP + ,RNPList,ConjRNP,Base_rr_RNP,Base_nr_RNP,Base_rn_RNP,Cons_rr_RNP,Cons_nr_RNP] + ** { flags startcat=Phr ; fun @@ -21,8 +24,8 @@ abstract TestLang = ComplSlashSlash: VPSlashSlash -> NP -> VPSlash ; -- Passive - PastPartAP : VPSlash -> AP ; -- lost (opportunity) ; (opportunity) lost in space - PassVPSlash : VPSlash -> VP ; -- from ExtraGer, to be corrected +-- PastPartAP : VPSlash -> AP ; -- lost (opportunity) ; (opportunity) lost in space +-- PassVPSlash : VPSlash -> VP ; -- from ExtraGer, to be corrected PassV2S : V2S -> S -> VP ; PassV2Q : V2Q -> QS -> VP ; @@ -39,5 +42,12 @@ abstract TestLang = fun RelSlash : RP -> ClauseSlash -> RCl ; SlashVP : NP -> VPSlash -> ClauseSlash ; + QuestSlash : IP -> ClauseSlash -> QCl ; -- whom does John love +-- QCl = {s : Mood => ResGer.Tense => Anteriority => Polarity => QForm => Str} ; + AdvSlash : ClauseSlash -> Adv -> ClauseSlash ; + SlashPrep : Cl -> Prep -> ClauseSlash ; + SlashVS : NP -> VS -> SSlash -> ClauseSlash ; + UseSlash : Temp -> Pol -> ClauseSlash -> SSlash ; + ReflPossPron : Pron -> RNP -> NP ; -- not ReflPossPron : Pron -> Quant of Extend } ; diff --git a/tests/german/TestLangEng.gf b/tests/german/TestLangEng.gf index 9940ada8..6199a445 100644 --- a/tests/german/TestLangEng.gf +++ b/tests/german/TestLangEng.gf @@ -5,7 +5,9 @@ concrete TestLangEng of TestLang = GrammarEng , TestLexiconEng , ConstructionEng - ** open (R=ResEng), (P=ParadigmsEng), Prelude, (E=ExtendEng) + , ExtendEng[PastPartAP,PassVPSlash, + RNP,ReflRNP,ReflPron,ReflPoss,PredetRNP,AdvRNP,ReflA2RNP,PossPronRNP,ReflPossPron] + ** open (R=ResEng), (P=ParadigmsEng), Prelude --, (E=ExtendEng) in { flags @@ -43,8 +45,8 @@ concrete TestLangEng of TestLang = let vps = R.insertObj (\\_ => v.s ! R.VPPart ++ v.p) (R.predAux R.auxBe) ** {c2 = v.c2} in R.insertObj (\\_ => vps.c2 ++ np.s ! R.NPAcc) vps ; - PastPartAP = E.PastPartAP ; - PassVPSlash = E.PassVPSlash ; +-- PastPartAP = E.PastPartAP ; +-- PassVPSlash = E.PassVPSlash ; Pass2V4 v np = let vpss = R.insertObj (\\_ => v.s ! R.VPPart ++ v.p) (R.predAux R.auxBe) ** {c2 = v.c3 ; c3 = v.c4} diff --git a/tests/german/TestLangGer.gf b/tests/german/TestLangGer.gf index 4fe2bf14..74d1012c 100644 --- a/tests/german/TestLangGer.gf +++ b/tests/german/TestLangGer.gf @@ -2,9 +2,12 @@ -- use the modified files in gf-rgl/src/german concrete TestLangGer of TestLang = - GrammarGer - [SlashVP, RelSlash] + GrammarGer - [SlashVP,RelSlash,QuestSlash,AdvSlash,SlashPrep,SlashVS,UseSlash] , TestLexiconGer , ConstructionGer + , ExtraGer[RNP,ReflRNP,ReflPron,ReflPoss,PredetRNP + ,RNPList,ConjRNP --,Base_rr_RNP,Base_nr_RNP,Base_rn_RNP,Cons_rr_RNP,Cons_nr_RNP + ] ** open ResGer,Prelude,(P=ParadigmsGer) in { flags startcat = Phr ; unlexer = text ; lexer = text ; @@ -28,42 +31,34 @@ concrete TestLangGer of TestLang = (insertObjRefl (predVc v3) ** {c2 = v3.c3}); PassV2Q v q = - let c = case of { - => NPC Nom ; _ => v.c2.c} ; -- acc;pcase object -> nom;pcase subject - vp = insertObj (\\_ => v.s ! VPastPart APred) (predV werdenPass) - ** { c1 = v.c2 ** {c = c} } + let vp = insertObj (\\_ => v.s ! VPastPart APred) (predV werdenPass) + ** { c1 = subjPrep v.c2 } in insertExtrapos (bindComma ++ q.s ! QIndir) vp ; PassV2S v s = - let c = case of { - => NPC Nom ; _ => v.c2.c} ; -- acc;pcase object -> nom;pcase subject - vp = insertObj (\\_ => v.s ! VPastPart APred) (predV werdenPass) - ** { c1 = v.c2 ** {c = c} } + let vp = insertObj (\\_ => v.s ! VPastPart APred) (predV werdenPass) + ** { c1 = subjPrep v.c2 } in insertExtrapos (bindComma ++ conjThat ++ s.s ! Sub) vp ; PassV2V v vp = - let - inf = mkInf v.isAux Simul Pos vp ; -- ok for v.isAux=False, v.c2.c=Acc - c = case of { -- v.objCtrl=True HL 3/22 - => NPC Nom ; _ => v.c2.c} ; -- acc;pcase object -> nom;pcase subject + let -- ok for v.isAux=False, + inf = mkInf v.isAux Simul Pos vp ; -- v.c2.c=Acc, v.objCtrl=True HL 3/22 vp2 = insertObj (\\_ => v.s ! VPastPart APred) (predV werdenPass) - ** { c1 = v.c2 ** {c = c} } ; + ** { c1 = subjPrep v.c2 } ; in insertInf inf vp2 ; -- v=lassen needs in-place inf instead - PassVPSlash vp = - let c = case of { - => NPC Nom ; _ => vp.c2.c} ; - ctrl = case vp.objCtrl of { True => False ; _ => True } -- always False? - in -- insertObj (\\_ => (PastPartAP vp).s ! APred) (predV werdenPass ** {c1 = vp.c2 ** {c = c}}) - insertObj (\\_ => vp.s.s ! (VPastPart APred)) - (predV werdenPass ** {nn = vp.nn ; c1 = vp.c2 ** {c = c}}) - ** {ext = vp.ext ; inf = vp.inf ; c2 =vp.c2 ; objCtrl = ctrl } ; -- c2 ? - -- Scharolta: passivised object: acc object -> nom subject; all others: same case/prep + PassVPSlash vp = -- less correct in ExtraGer.gf with inserting + let -- (\\_ => (PastPartAP vp).s ! APred) + ctrl = case vp.objCtrl of { True => False ; _ => True } -- always False? + in + insertObj (\\_ => vp.a2 ++ vp.adj ++ vp.s.s ! (VPastPart APred)) + (predV werdenPass ** {nn = vp.nn ; c1 = subjPrep vp.c2}) + ** {ext = vp.ext ; inf = vp.inf ; c2 = vp.c2 ; objCtrl = ctrl } ; -- c2 ? -- HL: does not work for vp = (Slash2V3 v np): uns wird *den Beweis erklärt -- 3/22 works for vp = (SlashV2V v2v reflVP): wir werden gebeten, uns zu waschen PastPartAP vp = { - s = \\af => (vp.nn ! agrP3 Sg).p1 ++ (vp.nn ! agrP3 Sg).p2 ++ + s = \\af => (vp.nn ! agrP3 Sg).p1 ++ (vp.nn ! agrP3 Sg).p2 ++ (vp.nn ! agrP3 Sg).p3 ++ (vp.nn ! agrP3 Sg).p4 ++ vp.adj ++ vp.a2 ++ vp.inf.inpl.p2 ++ vp.s.s ! VPastPart af ; isPre = True ; @@ -164,29 +159,49 @@ gr -tr (PredVP (UsePron ?) (ComplSlash (SlashV2V lassen_V2V (ReflVP (SlashV2a wa } ; lin + SlashVP np vp = let subj = mkSubj np vp.c1 in mkClSlash subj.p1 subj.p2 vp ** { c2 = vp.c2 } ; RelSlash rp cls = lin RCl { s = \\m,t,a,p,gn => - appPrep cls.c2 (\\k => usePrepC k (\c -> rp.s ! gn ! c)) ++ - cls.s ! m ! t ! a ! p ! Sub ! gn ; + appPrepC cls.c2 (rp.s ! gn) ++ + cls.s ! m ! t ! a ! p ! Sub ! gn ; c = (prepC cls.c2.c).c } ; -{- - QuestSlash ip slash = { + + QuestSlash ip slash = let gn : GenNum = case ip.n of {Sg => GSg Masc ; _ => GPl} in { s = \\m,t,a,p => let cls = slash.s ! m ! t ! a ! p ; - who = appPrep slash.c2 (\\k => usePrepC k (\c -> ip.s ! c)) ; + who = appPrepC slash.c2 ip.s ; in table { - QDir => who ++ cls ! Inv ; - QIndir => who ++ cls ! Sub + QDir => who ++ cls ! Inv ! (RGenNum gn); + QIndir => who ++ cls ! Sub ! (RGenNum gn) } } ; --} + AdvSlash slash adv = { + s = \\m,t,a,b,o,gn => slash.s ! m ! t ! a ! b ! o ! gn ++ adv.s ; + c2 = slash.c2 + } ; + + SlashPrep cl prep = { + s = \\m,t,a,p,o,gn => cl.s ! m ! t ! a ! p ! o ; + c2 = prep + } ; + + SlashVS np vs slash = + let subj = mkSubj np PrepNom ; + vps = insertExtrapos (conjThat ++ slash.s ! Sub) (predV vs) + ** {c2 = slash.c2 ; objCtrl = False} -- default objCtrl guessed + in mkClSlash subj.p1 subj.p2 vps ; + + UseSlash t p cl = { + s = \\o => t.s ++ p.s ++ cl.s ! t.m ! t.t ! t.a ! p.p ! o ! RSentence ; + c2 = cl.c2 + } ; oper gnToAgr : RelGenNum -> Agr = \gn -> diff --git a/tests/german/TestLexiconEng.gf b/tests/german/TestLexiconEng.gf index 7a4477ef..0f485244 100644 --- a/tests/german/TestLexiconEng.gf +++ b/tests/german/TestLexiconEng.gf @@ -59,5 +59,7 @@ lin warnen_V2V = defaultV2V (regV "warn") ; -- typ=VVInf versprechen_dat_V2V = defaultV2V (regV "promise") ; -- typ=VVInf lassen_V2V = ParadigmsEng.mkV2V (I.let_V) ; -- typ=VVAux - + -- aci verb: + sehen_V2V = mkV2V (I.see_V) ; + hoeren_V2V = mkV2V (I.hear_V) ; } diff --git a/tests/german/TestLexiconGer.gf b/tests/german/TestLexiconGer.gf index ed94e82a..38baf297 100644 --- a/tests/german/TestLexiconGer.gf +++ b/tests/german/TestLexiconGer.gf @@ -69,5 +69,7 @@ lin -- subject control verb: versprechen_dat_V2V = subjV2V (mkV2V (irregV "versprechen" "verspricht" "versprach" "verspräche" "versprochen") datPrep) ; - + -- aci verb: + sehen_V2V = auxV2V (irregV "sehen" "sieht" "sah" "sähe" "gesehen") accPrep ; + hoeren_V2V = auxV2V (regV "hören") accPrep ; } diff --git a/tests/german/TestLexiconGerAbs.gf b/tests/german/TestLexiconGerAbs.gf index 0e5d0879..aa3113ee 100644 --- a/tests/german/TestLexiconGerAbs.gf +++ b/tests/german/TestLexiconGerAbs.gf @@ -33,6 +33,9 @@ fun warnen_V2V : V2V ; -- -aux, object control versprechen_dat_V2V : V2V ; -- -aux, subject control lassen_V2V : V2V ; -- +aux(inf), object control + -- aci verb: -- +aux(inf), object control + sehen_V2V : V2V ; + hoeren_V2V : V2V ; cat V4 ; diff --git a/tests/german/infinitives.trees b/tests/german/infinitives.trees index ef80d911..75792a1f 100644 --- a/tests/german/infinitives.trees +++ b/tests/german/infinitives.trees @@ -193,3 +193,14 @@ DetCN (DetQuant DefArt NumSg) (RelCN (UseN boy_N) (UseRCl (TTAnt TPres ASimul) P PredVP (UsePN john_PN) (ComplVS say_VS (UseCl (TTAnt TPast ASimul) PPos (PredVP (UsePron we_Pron) (ComplVV want_VV (ComplSlash (SlashV2V lassen_V2V (ComplSlash (SlashV2V helfen_V2V (ComplSlash (SlashV2A paint_V2A (PositA blue_A)) (DetCN (DetQuant DefArt NumSg) (UseN house_N)))) (UsePron he_Pron))) (DetCN (DetQuant DefArt NumPl) (UseN child_N))))))) +-- aci + +PhrUtt NoPConj (UttS (UseCl (TTAnt TPast ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2V sehen_V2V (UseV sleep_V)) (DetCN (DetQuant DefArt NumSg) (UseN dog_N)))))) NoVoc + +PredVP (UsePron we_Pron) (ComplSlash (SlashV2VNP hoeren_V2V (DetCN (DetQuant DefArt NumPl) (UseN man_N)) (Slash2V3 talk_V3 (UsePron he_Pron))) (DetCN (DetQuant (PossPron they_Pron) NumPl) (UseN wife_N))) + +PredVP (UsePron we_Pron) (ComplSlash (SlashV2V hoeren_V2V (ComplSlash (Slash2V3 talk_V3 (UsePron he_Pron)) (DetCN (DetQuant (PossPron they_Pron) NumPl) (UseN wife_N)))) (DetCN (DetQuant DefArt NumPl) (UseN man_N))) + +PredVP (UsePron we_Pron) (ComplSlash (SlashV2V hoeren_V2V (ComplSlash (Slash3V3 talk_V3 (DetCN (DetQuant (PossPron they_Pron) NumPl) (UseN wife_N))) (UsePron he_Pron))) (DetCN (DetQuant DefArt NumPl) (UseN man_N))) + +