diff --git a/src/german/AdjectiveGer.gf b/src/german/AdjectiveGer.gf index 3504a8f07..9d44194d8 100644 --- a/src/german/AdjectiveGer.gf +++ b/src/german/AdjectiveGer.gf @@ -40,27 +40,27 @@ concrete AdjectiveGer of Adjective = CatGer ** open ResGer, Prelude in { -- $SuperlA$ belongs to determiner syntax in $Noun$. - ComplA2 a np = + ComplA2 a np = let CExt = case a.c2.isPrep of { - isCase => ; - _ => <[], appPrepNP a.c2 np> } -- HL: check 7/22 + isCase => ; + _ => <[], appPrepNP a.c2 np> } in { - s = a.s ! Posit ; - isPre = True ; - c = CExt ; - ext = [] + s = a.s ! Posit ; + isPre = True ; + c = CExt ; + ext = [] } ; ReflA2 a = let compl = appPrep a.c2 (reflPron ! agrP3 Sg) ; CExt = case a.c2.isPrep of - {isCase => ; _ => <[], compl> } + {isCase => ; _ => <[], compl> } in { s = a.s ! Posit ; isPre = True ; c = CExt ; - ext = [] + ext = [] } ; SentAP ap sc = ap ** { diff --git a/src/german/AdverbGer.gf b/src/german/AdverbGer.gf index 29bf0d2bc..6cf2673df 100644 --- a/src/german/AdverbGer.gf +++ b/src/german/AdverbGer.gf @@ -3,10 +3,8 @@ concrete AdverbGer of Adverb = CatGer ** open ResGer, Prelude in { lin PositAdvAdj a = {s = a.s ! Posit ! APred} ; - ComparAdvAdj cadv a np = - let nps = np.s ! False ! Nom ++ bigNP np in - { - s = cadv.s ++ a.s ! Posit ! APred ++ cadv.p ++ nps + ComparAdvAdj cadv a np = { + s = cadv.s ++ a.s ! Posit ! APred ++ cadv.p ++ np.s ! False ! Nom ++ bigNP np } ; ComparAdvAdjS cadv a s = { s = cadv.s ++ a.s ! Posit ! APred ++ cadv.p ++ s.s ! Sub diff --git a/src/german/CatGer.gf b/src/german/CatGer.gf index 5082cf563..72a55eb3c 100644 --- a/src/german/CatGer.gf +++ b/src/german/CatGer.gf @@ -58,18 +58,15 @@ concrete CatGer of Cat = adv : Str ; -- Haus [adv auf dem Hügel] g : Gender } ; - Pron = {s : NPForm => Str ; a : Agr} ; - - -- simplified PCase to Case in NP, Det, DAP, Quant, Predet HL 8/22 NP = ResGer.NP ; - Det = {s,sp : Bool => Gender => Case => Str ; -- True if DefArt is dropped HL 8/22 - n : Number ; a : Adjf ; isDef, hasDefArt : Bool } ; - DAP = {s,sp : Gender => Case => Str ; n : Number ; a : Adjf ; isDef, hasDefArt : Bool } ; - + Pron = {s : NPForm => Str ; a : Agr} ; + Det = {s,sp : Bool => Gender => Case => Str ; -- True if DefArt is dropped, HL 8/22 + n : Number ; a : Adjf ; isDef, hasDefArt : Bool} ; + DAP = {s,sp : Gender => Case => Str ; n : Number ; a : Adjf ; isDef,hasDefArt : Bool} ; -- HL 7/2022: first Bool = True if used to glue in Sg with preposition -- second Bool is True if a cardinal number is present - Quant = { - s, sp : Bool => Bool => Number => Gender => Case => Str ; + Quant = { + s, sp : Bool => Bool => Number => Gender => Case => Str ; a : Adjf ; aPl : Adjf ; --- to distinguish "meine guten Freunde" / "gute Freunde" hasDefArt : Bool @@ -145,4 +142,5 @@ concrete CatGer of Cat = Det = \det -> det.s ! False ! Masc ! Nom ; Prep = \prep -> case prep.isPrep of {isPrepDefArt => prep.s ! GSg Masc ; _ => prep.s ! GPl } ; + } diff --git a/src/german/ConjunctionGer.gf b/src/german/ConjunctionGer.gf index 9abc56ed0..790461bd5 100644 --- a/src/german/ConjunctionGer.gf +++ b/src/german/ConjunctionGer.gf @@ -9,11 +9,15 @@ concrete ConjunctionGer of Conjunction = ConjAdv conj ss = conjunctDistrSS conj ss ; - -- ConjNP : Conj -> ListNP' -> NP' ; -- she or we - - ConjNP conj ss = { s = \\_ => (conjunctDistrTable Case conj { s1 = ss.s1 ; s2 = ss.s2 }).s } ** { - a = Ag Fem (conjNumber conj.n (numberAgr ss.a)) (personAgr ss.a) ; - w = WHeavy ; ext,rc = [] } ; + ConjNP conj ss = heavyNP ( + {s = \\_ => (conjunctDistrTable Case conj ss).s ; + a = let n : Number = (conjNumber conj.n (numberAgr ss.a)) ; + p : Person = personAgr ss.a ; + agr : Agr = case of { => AgPl q ; + => AgSgP3 Neutr ; + => AgSgP1 ; + => AgSgP2 } + in (conjAgr agr ss.a) }) ; ConjAP conj ss = conjunctDistrTable AForm conj ss ** { isPre = ss.isPre ; c = ss.c ; ext = ss.ext} ; diff --git a/src/german/ConstructionGer.gf b/src/german/ConstructionGer.gf index 95e5b0c11..7f43a4a25 100644 --- a/src/german/ConstructionGer.gf +++ b/src/german/ConstructionGer.gf @@ -19,7 +19,7 @@ oper neuter = P.neuter ; regV = P.regV ; invarA = P.invarA ; - + lin hungry_VP = mkVP (P.mkA "hungrig") ; thirsty_VP = mkVP (P.mkA "durstig") ; @@ -42,14 +42,11 @@ lin -- some more things weather_adjCl ap = mkCl (mkVP (lin AP ap)) ; - is_right_VP = mkVP have_V2 (mkNP (ParadigmsGer.mkN "Recht")) ; - is_wrong_VP = mkVP have_V2 (mkNP (ParadigmsGer.mkN "Unrecht")) ; + is_right_VP = mkVP have_V2 (mkNP (P.mkN "Recht")) ; + is_wrong_VP = mkVP have_V2 (mkNP (P.mkN "Unrecht")) ; --- n_units_AP card cn a = mkAP (lin AdA (mkUtt (mkNP (lin CN cn)))) (lin A a) ; - n_units_AP card cn a = mkAP (lin AdA (mkUtt (mkNP card cn))) a ; - --- n_unit_CN card unit cn = mkCN (invarA (mkUtt (mkNP (lin CN unit))).s) cn ; - n_unit_CN card unit cn = mkCN (invarA ((mkUtt card).s ++ (mkUtt unit).s)) cn ; + n_units_AP card cn a = mkAP (lin AdA (mkUtt (mkNP (lin CN cn)))) (lin A a) ; + n_unit_CN card unit cn = mkCN (invarA (mkUtt (mkNP (lin CN unit))).s) cn ; bottle_of_CN np = N.ApposCN (mkCN (P.mkN "Flasche")) np ; cup_of_CN np = N.ApposCN (mkCN (P.mkN "Tasse")) np ; @@ -177,9 +174,9 @@ lin monthAdv m = SyntaxGer.mkAdv inDat_Prep (mkNP the_Det m) ; yearAdv y = SyntaxGer.mkAdv (mkPrep "im Jahr" dative) y ; ---- - dayMonthAdv d m = ParadigmsGer.mkAdv ("am" ++ d.s ! True ! dative ++ BIND ++ "." ++ m.s ! R.Sg ! R.Nom) ; -- am 17 Mai + dayMonthAdv d m = ParadigmsGer.mkAdv ("am" ++ d.s ! True ! dative ++ BIND ++ "." ++ m.s ! R.Sg ! R.Nom) ; -- am 17. Mai monthYearAdv m y = SyntaxGer.mkAdv inDat_Prep (mkNP the_Det (mkCN m y)) ; -- im Mai 2012 - dayMonthYearAdv d m y = ParadigmsGer.mkAdv ("am" ++ d.s ! True ! dative ++ BIND ++ "." ++ m.s ! R.Sg ! R.Nom ++ y.s ! False ! accusative) ; -- am 17 Mai 2013 + dayMonthYearAdv d m y = ParadigmsGer.mkAdv ("am" ++ d.s ! True ! dative ++ BIND ++ "." ++ m.s ! R.Sg ! R.Nom ++ y.s ! True ! accusative) ; -- am 17. Mai 2013 intYear = symb ; intMonthday = symb ; diff --git a/src/german/DocumentationGerFunctor.gf b/src/german/DocumentationGerFunctor.gf index 0ec5665fa..13b24527d 100644 --- a/src/german/DocumentationGerFunctor.gf +++ b/src/german/DocumentationGerFunctor.gf @@ -25,13 +25,13 @@ oper lin InflectionN, InflectionN2, InflectionN3 = \noun -> { t = "s" ; - s1 = heading1 (heading noun_Category ++ + s1 = heading1 (heading noun_Category ++ case noun.g of { - Masc => "("+heading masculine_Parameter+")" ; + Masc => "("+heading masculine_Parameter+")" ; Fem => "("+heading feminine_Parameter+")" ; Neutr => "("+heading neuter_Parameter+")" }) ; - s2 = frameTable ( + s2 = frameTable ( tr (th "" ++ th (heading singular_Parameter) ++ th (heading plural_Parameter) ) ++ tr (th (heading nominative_Parameter) ++ td (noun.s ! Sg ! Nom) ++ td (noun.s ! Pl ! Nom)) ++ tr (th (heading genitive_Parameter) ++ td (noun.s ! Sg ! Gen) ++ td (noun.s ! Pl ! Gen)) ++ @@ -42,9 +42,9 @@ lin InflectionPN = \pn -> { t = "pn" ; - s1 = heading1 ("Eigenname" ++ + s1 = heading1 ("Eigenname" ++ "("+case of { - => heading masculine_Parameter ; + => heading masculine_Parameter ; => heading feminine_Parameter ; => heading neuter_Parameter ; <_,Pl> => heading plural_Parameter @@ -59,9 +59,9 @@ lin InflectionGN = \gn -> { t = "vn" ; - s1 = heading1 ("Vorname" ++ + s1 = heading1 ("Vorname" ++ case gn.g of { - Male => "(männlich)" ; + Male => "(männlich)" ; Female => "(weiblich)" }) ; s2 = frameTable ( @@ -85,9 +85,9 @@ lin InflectionLN = \ln -> { t = "pn" ; - s1 = heading1 ("Standortnamen" ++ + s1 = heading1 ("Standortnamen" ++ "("+case of { - => heading masculine_Parameter ; + => heading masculine_Parameter ; => heading feminine_Parameter ; => heading neuter_Parameter ; <_,Pl> => heading plural_Parameter @@ -108,8 +108,8 @@ lin td (adj.s ! d ! (AMod (GSg Neutr) c)) ++ td (adj.s ! d ! (AMod GPl c)) ; dtable : Parameter -> Degree -> Str = \s,d -> - paragraph (heading2 (heading s) ++ frameTable ( - tr (th [] ++ th (heading masculine_Parameter) ++ th (heading feminine_Parameter) ++ th (heading neuter_Parameter) ++ + paragraph (heading2 (heading s) ++ frameTable ( + tr (th [] ++ th (heading masculine_Parameter) ++ th (heading feminine_Parameter) ++ th (heading neuter_Parameter) ++ th (heading plural_Parameter)) ++ tr (th (heading nominative_Parameter) ++ gforms d Nom) ++ tr (th (heading genitive_Parameter) ++ gforms d Gen) ++ diff --git a/src/german/ExtendGer.gf b/src/german/ExtendGer.gf index b600ecdc1..ddfa488db 100644 --- a/src/german/ExtendGer.gf +++ b/src/german/ExtendGer.gf @@ -4,10 +4,11 @@ concrete ExtendGer of Extend = CatGer ** ExtendFunctor - [ InOrderToVP, - VPS, ListVPS, VPI, ListVPI, + VPS, ListVPS, VPI, ListVPI, RNP, RNPList, MkVPS, BaseVPS, ConsVPS, ConjVPS, PredVPS, MkVPI, BaseVPI, ConsVPI, ConjVPI, ComplVPIVV, - GenModNP, + ComplSlashPartLast, + Base_nr_RNP, Base_rn_RNP, Base_rr_RNP, Conj_RNP, CardCNCard, CompoundN, PassVPSlash, PassAgentVPSlash, PastPartAP, PastPartAgentAP ] @@ -26,9 +27,9 @@ concrete ExtendGer of Extend = VPS = {s : Order => Agr => Str} ; [VPS] = {s1,s2 : Order => Agr => Str} ; - lin +lin - InOrderToVP vp = {s = "um" ++ useInfVP False vp} ; + InOrderToVP vp = {s = "um" ++ useInfVP False vp} ; BaseVPI = twoTable Bool ; ConsVPI = consrTable Bool comma ; @@ -70,7 +71,7 @@ concrete ExtendGer of Extend = t = tm.t ; m = tm.m ; subj = [] ; - verb = vps.s ! ord ! agr ! VPFinite m t a ; + verb = vps.s ! ord ! agr2vagr 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 ; @@ -123,25 +124,25 @@ concrete ExtendGer of Extend = } ; UseDAPMasc det = { - s = \\_,c => det.sp ! Masc ! c ; + s = \\b,c => det.sp ! Masc ! c ; a = agrP3 det.n ; w = WLight ; rc, ext = [] } ; UseDAPFem det = { - s = \\_,c => det.sp ! Fem ! c ; + s = \\b,c => det.sp ! Fem ! c ; a = agrP3 det.n ; w = WLight ; rc, ext = [] } ; - CardCNCard card cn = { - s = \\g,c => - (Grammar.DetCN (Grammar.DetQuant Grammar.IndefArt (Grammar.NumCard card)) cn).s ! False ! c ; - n = Pl - } ; - +lin + CardCNCard card cn = { + s = \\g,c => + (Grammar.DetCN (Grammar.DetQuant Grammar.IndefArt (Grammar.NumCard card)) cn).s ! False ! c ; + n = Pl + } ; lin PassVPSlash vp = insertObj (\\_ => (PastPartAP vp).s ! APred) (predV werdenPass) ** @@ -167,7 +168,7 @@ lin PastPartAgentAP vp np = in { s = \\af => (vp.nn ! a).p1 ++ (vp.nn ! a).p2 ++ (vp.nn ! a).p3 ++ vp.a2 ++ agent ++ vp.adj ++ vp.inf.inpl.p2 - ++ vp.c2.s ! GPl -- junk if not TV + ++ vp.c2.s ! GPl -- junk if not TV ++ vp.ext ++ (vp.inf.extr ! a) ++ vp.s.s ! VPastPart af ; isPre = True ; c = <[],[]> ; @@ -186,4 +187,118 @@ lin CompoundN a x = g = x.g } ; + +-- Reflexive noun phrases -- (HL 5/2022: improved and completed, RNPList added) + + lincat + RNP = {s : Agr => Case => Str ; rc,ext : Str ; isPron : Bool} ; -- Case, not PCase !!! + RNPList = {s1,s2 : Agr => Case => Str} ; + + linref + RNP = \rnp -> rnp.s ! AgSgP3 Masc ! Acc ++ rnp.ext ++ rnp.rc ; + + lin + ReflRNP vps rnp = + insertObjReflNP rnp vps ; + + ReflPron = { -- with personal pronoun nominative + s = ResGer.reflPron ; rc,ext = [] ; isPron = True } ; + + -- 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 + + 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 : Number = case pred.a of {PAg n => n ; _ => numberAgr a} ; + g : Gender = 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 ! c ++ "von" ++ rnp.s ! a ! Dat ; + _ => pred.s ! n ! genderAgr a ! 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 ! c + ++ appPrep 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 = appPrep 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 = appPrep 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 = + GrammarGer.DetCN (GrammarGer.DetQuant (GrammarGer.PossPron pron) num) + (GrammarGer.PossNP cn (lin NP {s = \\pc => -- usePrepC pc (\c -> rnp.s ! pron.a ! c) ; + rnp.s ! pron.a ! pc ; + 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 ! False ! c ++ x.ext ++ x.rc} y ; + Base_rn_RNP x y = twoTable2 Agr Case x {s = \\_,c => y.s ! False ! 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 ! False ! c ++ x.ext ++ x.rc} xs ; +{- + 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)) ; + + insertObjReflNP : RNP -> ResGer.VPSlash -> ResGer.VP = -- HL 5/2022 + \rnp,vp -> insertObjRNP rnp vp.c2 vp ; + + insertObjRNP : RNP -> Preposition -> ResGer.VPSlash -> ResGer.VP = -- HL 5/2022 + \rnp,prep,vp -> -- 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 + } ; +-} } diff --git a/src/german/ExtraGer.gf b/src/german/ExtraGer.gf index 14eae0bea..7772ea5ba 100644 --- a/src/german/ExtraGer.gf +++ b/src/german/ExtraGer.gf @@ -1,6 +1,5 @@ concrete ExtraGer of ExtraGerAbs = CatGer ** open ResGer, Coordination, Prelude, IrregGer, (P = ParadigmsGer), (N = NounGer) in { - flags coding=utf8 ; lincat @@ -30,21 +29,21 @@ concrete ExtraGer of ExtraGerAbs = CatGer ** 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 = ""} ; + CompIQuant iq = {s = table {a => iq.s ! numberAgr a ! genderAgr a ! Nom} ; ext = ""} ; IAdvAdv adv = {s = "wie" ++ adv.s} ; DetNPMasc det = { s = \\b,c => det.sp ! b ! Masc ! c ; a = agrgP3 Masc det.n ; - w = case det.isDef of { True => WLight ; _ => WHeavy } ; + w = case det.isDef of {True => WLight ; _ => WHeavy} ; ext, rc = [] } ; DetNPFem det = { s = \\b,c => det.sp ! b ! Fem ! c ; a = agrgP3 Fem det.n ; - w = case det.isDef of { True => WLight ; _ => WHeavy } ; + w = case det.isDef of {True => WLight ; _ => WHeavy} ;--WLight ; ext, rc = [] } ; @@ -55,10 +54,8 @@ concrete ExtraGer of ExtraGerAbs = CatGer ** } ; PassVPSlash vp = - let c = case of { => 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 @@ -85,7 +82,7 @@ concrete ExtraGer of ExtraGerAbs = CatGer ** in { s = \\af => (vp.nn ! a).p1 ++ (vp.nn ! a).p2 ++ (vp.nn ! a).p3 ++ vp.a2 ++ agent ++ vp.adj ++ vp.inf.inpl.p2 - ++ vp.c2.s ! GPl -- junk if not TV + ++ vp.c2.s ! GPl -- junk if not TV ++ vp.ext ++ (vp.inf.extr ! a) ++ vp.s.s ! VPastPart af ; isPre = True ; c = <[],[]> ; @@ -122,12 +119,13 @@ concrete ExtraGer of ExtraGerAbs = CatGer ** Sub => True ; -- glue prefix to verb _ => False } ; + vagr = agr2vagr agr ; b = p.p ; a = tm.a ; t = tm.t ; m = tm.m ; subj = [] ++ tm.s ++ p.s ; - verb = vps.s ! ord ! agr ! VPFinite m t a ; + verb = vps.s ! ord ! vagr ! 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 ; @@ -179,13 +177,13 @@ concrete ExtraGer of ExtraGerAbs = CatGer ** RNPList = {s1,s2 : Agr => Case => Str} ; linref - RNP = \rnp -> rnp.s ! (Ag Masc Sg P3) ! Acc ++ rnp.ext ++ rnp.rc ; + RNP = \rnp -> rnp.s ! AgSgP3 Masc ! Acc ++ rnp.ext ++ rnp.rc ; lin ReflRNP vps rnp = - insertObj (\\a => appPrep vps.c2 (rnp.s ! a)) vps ; + insertObjReflNP rnp vps ; - ReflPron = { -- personal pronoun, with "sich" in P3 Sg + ReflPron = { -- with personal pronoun nominative s = ResGer.reflPron ; rc,ext = [] ; isPron = True } ; -- We might define ReflPron by the stronger reflPronSelf below, using "selbst" @@ -208,7 +206,7 @@ concrete ExtraGer of ExtraGerAbs = CatGer ** -- 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} ; + s = \\a,c => let n : Number = case pred.a of {PAg n => n ; _ => numberAgr a} ; g = genderAgr a ; d = case pred.c.k of {NoCase => c ; PredCase k => k} ; in case rnp.isPron of { @@ -266,10 +264,13 @@ 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)) ; - insertObjReflNP : ResGer.VPSlash -> RNP -> ResGer.VP = -- HL 5/2022 - \vp,rnp -> -- generalize ResGer.insertObjRefl - let prep = vp.c2 ; - c = case prep.isPrep of { isCase => prep.c ; _ => Acc } ; -- put rnp.ext ++ rnp.rc to vp.ext ? + insertObjReflNP : RNP -> ResGer.VPSlash -> ResGer.VP = -- HL 5/2022 + \rnp,vp -> insertObjRNP rnp vp.c2 vp ; + + insertObjRNP : RNP -> Preposition -> ResGer.VPSlash -> ResGer.VP = -- HL 5/2022 + \rnp,prep,vp -> -- generalize ResGer.insertObjRefl + let -- prep = vp.c2 ; + c : Case = case prep.c of { cc => cc ; _ => Acc } ; -- put rnp.ext ++ rnp.rc to vp.ext ? obj : Agr => Str = \\a => prep.s ! GPl ++ rnp.s ! a ! c ++ rnp.ext ++ rnp.rc in vp ** { nn = \\a => @@ -280,7 +281,20 @@ concrete ExtraGer of ExtraGerAbs = CatGer ** => ; -- < non-pron nominal <_,_,_> => } -- or prepositional } ; - +{- insertObjRNP : RNP -> Preposition -> ResGer.VPSlash -> ResGer.VPSlash = -- HL 8/2023 + \rnp,prep,vp -> -- generalize ResGer.insertObjNP + let c = case prep.c of { NPC cc => cc ; _ => Acc } ; + 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 @@ -325,19 +339,19 @@ concrete ExtraGer of ExtraGerAbs = CatGer ** -- "es wird gelacht"; generating formal sentences lincat - FClause = ResGer.VP ** {subj : ResGer.NP ; lock_FClause : {}} ; + FClause = ResGer.VP ** {subj : ResGer.NP} ; lin VPass v = let vp = predV werdenPass - in lin FClause (vp ** {subj = esSubj ; - inf = vp.inf ** {s = v.s ! VPastPart APred } }) ; -- construct the formal clause + in vp ** {subj = esSubj ; + inf = vp.inf ** {s = v.s ! VPastPart APred } } ; -- construct the formal clause AdvFor adv fcl = fcl ** {a2 = adv.s} ; - FtoCl cl = - let subj = mkSubject cl.subj cl.c1 - in DisToCl subj.s subj.a cl ; + FtoCl cl = + let subj = mkSubject cl.subj cl.c1 + in DisToCl subj.s subj.a cl ; oper -- extra operations for ExtraGer @@ -348,7 +362,7 @@ concrete ExtraGer of ExtraGerAbs = CatGer ** esSubj : CatGer.NP = lin NP { s = \\_,_ => "es" ; rc, ext = [] ; - a = Ag Neutr Sg P3 ; + a = AgSgP3 Neutr ; w = WPron } ; @@ -360,7 +374,7 @@ concrete ExtraGer of ExtraGerAbs = CatGer ** Sub => True ; -- glue prefix to verb _ => False } ; - verb = vps.s ! ord ! agr ! VPFinite m t a ; + verb = vps.s ! ord ! agr2vagr agr ! VPFinite m t a ; neg = vp.a1 ++ negation ! b ; -- HL 8/19 vp.a1 ! b ; obj1 = (vp.nn ! agr).p1 ; obj2 = (vp.nn ! agr).p2 ++ (vp.nn ! agr).p3 ; diff --git a/src/german/ExtraGerAbs.gf b/src/german/ExtraGerAbs.gf index 54c29f61c..e63d01154 100644 --- a/src/german/ExtraGerAbs.gf +++ b/src/german/ExtraGerAbs.gf @@ -29,7 +29,7 @@ abstract ExtraGerAbs = Extra [ Pass3V3 : V3 -> VPSlash ; -- wir bekommen den Beweis erklärt - -- further constructions usin RNP, declared in abstract/Extra.gf: + -- further constructions using RNP, declared in abstract/Extra.gf or Extend.gf: AdvRNP : NP -> Prep -> RNP -> RNP ; -- a dispute with his wife AdvRVP : VP -> Prep -> RNP -> VP ; -- lectured about her travels @@ -39,4 +39,5 @@ abstract ExtraGerAbs = Extra [ -- NOTE: generalizes ReflA2 PossPronRNP : Pron -> Num -> CN -> RNP -> NP ; -- his abandonment of his wife and children + } diff --git a/src/german/GrammarGer.gf b/src/german/GrammarGer.gf index 410c401fe..5e2a85c28 100644 --- a/src/german/GrammarGer.gf +++ b/src/german/GrammarGer.gf @@ -1,7 +1,7 @@ --# -path=.:../abstract:../common:prelude -concrete GrammarGer of Grammar = - NounGer, +concrete GrammarGer of Grammar = + NounGer, VerbGer, AdjectiveGer, AdverbGer, @@ -13,7 +13,7 @@ concrete GrammarGer of Grammar = PhraseGer, TextX - [Tense,Temp], IdiomGer, - StructuralGer, -- AR: keep for BW comp - [part_Prep,possess_Prep], -- use PartNP, PossNP instead + StructuralGer, TenseGer, NamesGer ** { diff --git a/src/german/IdiomGer.gf b/src/german/IdiomGer.gf index fd39f1c7d..0d8d65fa5 100644 --- a/src/german/IdiomGer.gf +++ b/src/german/IdiomGer.gf @@ -8,23 +8,23 @@ concrete IdiomGer of Idiom = CatGer ** ImpersCl vp = mkClause "es" (agrP3 Sg) vp ; GenericCl vp = mkClause "man" (agrP3 Sg) vp ; - CleftNP np rs = mkClause "es" (agrP3 Sg) + CleftNP np rs = mkClause "es" (agrP3 Sg) (insertExtrapos (rs.s ! RGenNum (gennum (genderAgr np.a) (numberAgr np.a))) ---- - (insertObj (\\_ => (np.s ! False ! rs.c ++ bigNP np)) (predV MorphoGer.sein_V))) ; --HL + (insertObj (\\_ => np.s ! False ! rs.c ++ bigNP np) (predV MorphoGer.sein_V))) ; - CleftAdv ad s = mkClause "es" (agrP3 Sg) + CleftAdv ad s = mkClause "es" (agrP3 Sg) (insertExtrapos (conjThat ++ s.s ! Sub) (insertObj (\\_ => ad.s) (predV MorphoGer.sein_V))) ; ExistNP np = - mkClause "es" (agrP3 Sg) + mkClause "es" (agrP3 Sg) (insertObj (\\_ => appPrep geben.c2 (np.s ! False) ++ bigNP np) (predV geben)) ; ExistIP ip = { - s = \\m,t,a,p => - let + s = \\m,t,a,p => + let cls = (mkClause "es" (agrP3 Sg) (predV geben)).s ! m ! t ! a ! p ; who = ip.s ! Acc in table { @@ -53,7 +53,7 @@ concrete IdiomGer of Idiom = CatGer ** ProgrVP = insertAdv "eben" ; ---- ImpPl1 vp = {s = - (mkClause "wir" (Ag Fem Pl P1) vp).s ! + (mkClause "wir" (AgPl P1) vp).s ! MConjunct ! Pres ! Simul ! Pos ! Inv } ; @@ -65,7 +65,7 @@ concrete IdiomGer of Idiom = CatGer ** SelfAdvVP vp = insertAdv "selbst" vp ; SelfAdVVP vp = insertAdv "selbst" vp ; SelfNP np = np ** { - s = \\_,c => np.s ! False ! c ++ "selbst" ++ bigNP np ; + s = \\b,c => np.s ! b ! c ++ "selbst" ++ bigNP np ; isPron = False ; } ; diff --git a/src/german/LexiconGer.gf b/src/german/LexiconGer.gf index e0e5f03f2..8c2714a78 100644 --- a/src/german/LexiconGer.gf +++ b/src/german/LexiconGer.gf @@ -13,7 +13,7 @@ flags lin add_V3 = dirV3 (prefixV "hinzu" (regV "fügen")) zu_Prep ; airplane_N = mkN "Flugzeug" "Flugzeuge" neuter ; - alas_Interj = {s = "ach" } ; + alas_Interj = {s = "ach"} ; already_Adv = mkAdv "schon" ; answer_V2S = mkV2S (regV "antworten") datPrep ; apartment_N = mkN "Wohnung" ; @@ -186,8 +186,7 @@ lin sock_N = reg2N "Strumpf" "Strümpfe" masculine ; song_N = reg2N "Lied" "Lieder" neuter ; speak_V2 = dirV2 Irreg.sprechen_V ; --- star_N = mkN "Sterne" ; - star_N = mkN "Stern" ; -- HL 7/22 + star_N = mkN "Stern" ; steel_N = mkN "Stahl" ; stone_N = mkN "Stein" ; stop_V = seinV Irreg.halten_V ; @@ -214,7 +213,6 @@ lin university_N = reg2N "Universität" "Universitäten" feminine ; village_N = reg2N "Dorf" "Dörfer" neuter ; -- wait_V2 = prepV2 (regV "warten") (mkPrep "auf" accusative) ; --- wait_V2 = prepV2 (regV "warten") ((mkPrep "auf" "auf den" "auf die" "aufs" accusative) | (mkPrep "auf" accusative)); wait_V2 = prepV2 (regV "warten") (mkPrep "auf" "auf den" "auf die" ("aufs" | "auf das") accusative); walk_V = seinV Irreg.gehen_V ; warm_A = mk3A "warm" "wärmer" "wärmste" ; @@ -299,7 +297,7 @@ lin sand_N = mkN "Sand" ; seed_N = mkN "Same" ; skin_N = mkN "Haut" "Häute" feminine ; - sky_N = mkN "Himmel" ; ---- pl + sky_N = mkN "Himmel" ; smoke_N = mkN "Rauch" ; snow_N = mkN "Schnee" "Schneen" masculine ; ---- pl stick_N = mkN "Stock" "Stöcke" masculine ; diff --git a/src/german/MakeStructuralGer.gf b/src/german/MakeStructuralGer.gf index ff2ec97d3..be9dab510 100644 --- a/src/german/MakeStructuralGer.gf +++ b/src/german/MakeStructuralGer.gf @@ -5,7 +5,7 @@ resource MakeStructuralGer = open CatGer, (P = ParadigmsGer), MorphoGer, Prelude oper mkConj : Str -> Str -> Number -> Conj = \x,y,n -> {s1 = x ; s2 = y ; n = n ; lock_Conj = <>} ; - mkSubj : Str -> Subj = \x -> + mkSubj : Str -> Subj = \x -> {s = x ; lock_Subj = <>} ; mkIQuant : Str -> IQuant = \s -> {s = \\_,_,_ => s ; lock_IQuant = <>} ; @@ -13,16 +13,16 @@ oper mkPredet = overload { mkPredet : A -> Predet = \a -> lin Predet { - s = appAdj a ; + s = appAdj a ; c = noCase ; a = PAgNone - } ; + } ; mkPredet : A -> Str -> Case -> Bool -> Number -> Predet = \a,p,c,b,n -> lin Predet { - s = appAdj a ; - c = {p = p ; k = PredCase c} ; + s = appAdj a ; + c = {p = p ; k = PredCase c} ; a = case b of {True => PAg n ; _ => PAgNone} - } + } } ; -- e.g. das selbe diff --git a/src/german/NounGer.gf b/src/german/NounGer.gf index 9de307d2b..558ab8a14 100644 --- a/src/german/NounGer.gf +++ b/src/german/NounGer.gf @@ -3,9 +3,6 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in { flags optimize=all_subs ; --- Remark: np.isLight makes ResGer.insertObjNP expensive, for ComplSlash, SlashVP --- np.isLight = True and np.isPron = True are now part of np.w - -- HL 21.7.2022: the dropping of DefArt in Prep+DefArt works by selecting from -- np.s via b = det.hasDefArt = True the forms without det.s and from prep.s -- the preposition glued with definite article singular, depending on gender, case. @@ -33,13 +30,13 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in { UsePN pn = { s = \\_,c => pn.s ! c ; - a = agrgP3 pn.g Sg ; - w = WLight ; -- means: this is not a heavy NP, but comes before negation - rc, ext = [] -- Pron => Light HL 6/2019: to regulate Pron/NonPronNP order + a = agrgP3 pn.g pn.n ; + w = WLight ; -- means: this is not a heavy NP, but comes before negation + rc, ext = [] -- Pron => Light, HL 6/2019: to regulate Pron/NonPronNP order } ; UsePron pron = { - s = \\_,c => pron.s ! NPCase c ; + s = \\_,c => pron.s ! NPCase c ; a = pron.a ; w = WPron ; rc, ext = [] @@ -55,45 +52,45 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in { } ; PPartNP np v2 = np ** { - s = \\b,c => np.s ! b ! c ++ (embedInCommas (v2.s ! VPastPart APred)) ; --- invar part - w = WHeavy + s = \\b,c => np.s ! b ! c ++ embedInCommas (v2.s ! VPastPart APred) ; --- invar part + w = WHeavy } ; -- SS: "eine erfolgreiche Frau, geliebt von vielen," but only with v2 not possible in German? -- HL: PPartNP np vps|vp: "der Autor, heute vergessen" , "der Mond, gerade aufgegangen," AdvNP np adv = np ** { s = \\b,c => np.s ! b ! c ++ adv.s ; - w = WHeavy + w = WHeavy } ; ExtAdvNP np adv = np ** { - s = \\b,c => np.s ! b ! c ++ (embedInCommas adv.s) ; - w = WHeavy + s = \\b,c => np.s ! b ! c ++ embedInCommas adv.s ; + w = WHeavy } ; DetQuantOrd quant num ord = - let + let n = num.n ; a = quant.a in { - s = \\b,g,c => quant.s ! b ! num.isNum ! n ! g ! c ++ num.s!g!c ++ - ord.s ! agrAdj g (adjfCase a c) n c ; - sp = \\b,g,c => quant.sp ! b ! num.isNum ! n ! g ! c ++ num.s!g!c ++ - ord.s ! agrAdj g (adjfCase quant.aPl c) n c ; + s = \\b,g,c => quant.s ! b ! num.isNum ! n ! g ! c ++ num.s!g!c + ++ ord.s ! agrAdj g (adjfCase a c) n c ; + sp = \\b,g,c => quant.sp ! b ! num.isNum ! n ! g ! c ++ num.s!g!c + ++ ord.s ! agrAdj g (adjfCase quant.aPl c) n c ; n = n ; a = case n of {Sg => a ; Pl => quant.aPl} ; isDef = case of { => False ; _ => True} ; hasDefArt = quant.hasDefArt ; } ; - DetQuant quant num = - let + DetQuant quant num = + let n = num.n ; a = quant.a ; - b = andB quant.hasDefArt (case num.n of {Sg => True ; _ => False}) ; + b = andB quant.hasDefArt (case num.n of {Sg => True ; _ => False}) in { - s = \\b,g,c => quant.s ! b ! num.isNum ! n ! g ! c ++ num.s ! g ! c ; - sp = \\_,g,c => quant.sp ! False ! num.isNum ! n ! g ! c ++ num.s!g!c ; + s = \\b,g,c => quant.s ! b ! num.isNum ! n ! g ! c ++ num.s ! g ! c ; + sp = \\_,g,c => quant.sp ! False ! num.isNum ! n ! g ! c ++ num.s ! g ! c ; -- HL: der+er,den+en ; der drei,den drei+en n = n ; a = case n of {Sg => a ; Pl => quant.aPl} ; @@ -101,6 +98,7 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in { hasDefArt = quant.hasDefArt ; } ; + PossPron p = { s = \\_,_,n,g,c => p.s ! NPPoss (gennum g n) c ; sp = \\_,_,n,g,c => p.s ! NPPoss (gennum g n) c ; @@ -117,6 +115,7 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in { NumDigits numeral = {s = \\g,c => numeral.s ! NCard g c; n = numeral.n } ; OrdDigits numeral = {s = \\af => numeral.s ! NOrd af} ; + NumFloat dig1 dig2 = {s = \\g,c => dig1.s ! invNum ++ BIND ++ "." ++ BIND ++ dig2.s ! NCard g c ; n = Pl } ; NumDecimal numeral = {s = \\g,c => numeral.s ! NCard g c; n = numeral.n } ; NumNumeral numeral = {s = \\g,c => numeral.s ! NCard g c; n = numeral.n } ; @@ -129,20 +128,21 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in { OrdNumeralSuperl n a = {s = \\af => n.s ! NOrd APred ++ Predef.BIND ++ a.s ! Superl ! af} ; -- drittbeste DefArt = { - s = table{True => \\_,n,g,c => [] ; -- defart dropped + s = table{True => \\_,n,g,c => [] ; -- definite article dropped False => \\_,n,g,c => artDef ! (gennum g n) ! c} ; sp = \\_,_,n,g,c => case of { - => "denen" ; -- HL 6/2019 - => "derer" ; -- HL 6/2019 - _ => artDef ! (gennum g n) ! c } ; + => "denen" ; -- HL 6/2019 + => "derer" ; -- HL 6/2019 + _ => artDef ! (gennum g n) ! c } ; -- von den+en a, aPl = Weak ; - hasDefArt = True + hasDefArt = True } ; + IndefArt = { s = \\_ => table { True => \\_,_,c => [] ; False => table { - Sg => \\g,c => "ein" + pronEnding ! GSg g ! c ; + Sg => \\g,c => "ein" + pronEnding ! GSg g ! c ; Pl => \\_,c => [] } } ; @@ -176,8 +176,8 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in { ComplN2 f x = { s = \\_,n,c => f.s ! n ! c ++ appPrepNP f.c2 x ; g = f.g ; - rc = \\_ => [] ; - ext,adv = [] + rc = \\_ => [] ; + ext,adv = [] } ; ComplN3 f x = { @@ -187,7 +187,7 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in { 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 ; + g = f.g ; c2 = f.c3 ; } ; @@ -197,11 +197,11 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in { c2 = f.c3; } ; - AdjCN ap cn = + AdjCN ap cn = let - g = cn.g + g = cn.g in cn ** { - s = \\a,n,c => + s = \\a,n,c => preOrPost ap.isPre (ap.c.p1 ++ ap.c.p2 ++ ap.s ! agrAdj g a n c ++ ap.ext) (cn.s ! a ! n ! c) ; @@ -214,7 +214,7 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in { RelNP np rs = np ** { rc = np.rc ++ embedInCommas (rs.s ! RGenNum (gennum (genderAgr np.a) (numberAgr np.a))) ; - w = case isPron np of { True => WLight ; _ => np.w } + w = case isPron np of { True => WLight ; _ => np.w } } ; SentCN cn s = cn ** {ext = cn.ext ++ embedInCommas s.s} ; @@ -224,35 +224,34 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in { ApposCN cn np = let g = cn.g in cn ** { s = \\a,n,c => cn.s ! a ! n ! c ++ np.s ! False ! c ++ bigNP np } ; - -- PossNP cn np = cn ** { - -- s = \\a,n,c => cn.s ! a ! n ! c ++ np.s ! NPP CVonDat ++ bigNP np } ; PossNP cn np = cn ** { - s = \\a,n,c => cn.s ! a ! n ! c ++ appPrep vonDat (np.s ! False) ++ bigNP np } ; -- HL, ad hoc + s = \\a,n,c => cn.s ! a ! n ! c ++ appPrep vonDat (np.s ! False) ++ bigNP np } ; PartNP cn np = case np.w of { WPron => cn ** {s = \\a,n,c => cn.s ! a ! n ! c ++ appPrep vonDat (np.s ! False) ++ np.rc} ; - _ => cn ** {s = \\a,n,c => cn.s ! a ! n ! c ++ np.s ! False ! Gen} -- HL 7/2022, ad hoc + _ => cn ** {s = \\a,n,c => cn.s ! a ! n ! c ++ np.s ! False ! Gen ++ np.ext ++ np.rc} }; -- glass of wine CountNP det np = -- drei der Kinder | drei von den Kindern -- HL 7/22, ad-hoc TODO -- det or numeral? np or rather (DefArt +) cn? drei (einiger Kinder) ? - let g = genderAgr np.a + let g : Gender = genderAgr np.a in { s = \\b,c => det.s ! b ! g ! c ++ appPrepNP vonDat np ++ bigNP np ; a = agrgP3 g det.n ; w = case det.isDef of { True => WLight ; _ => WHeavy } ; rc = np.rc ; - ext = np.ext + ext = np.ext } ; AdjDAP dap ap = -- the large (one) -- HL 8/22 der auf dich stolze; die ihm treue; der so dumme, infzu - {s, sp = \\g,c => dap.s ! g ! c ++ ap.c.p1 ++ ap.c.p2 ++ ap.s ! (AMod (gennum g dap.n) c) ++ ap.ext ; + {s, sp = \\g,c => dap.s ! g ! c ++ ap.c.p1 ++ ap.c.p2 ++ ap.s ! (AMod (gennum g dap.n) c) ++ ap.ext ; a = dap.a ; n = dap.n ; isDef = dap.isDef ; hasDefArt = dap.hasDefArt } ; - - DetDAP det = {s = \\g,c => det.s ! False ! g ! c ; -- HL 7/22 todo: check - sp = \\g,c => det.sp ! False ! g ! c ; - n = det.n ; a = det.a ; isDef = det.isDef ; hasDefArt = det.hasDefArt} ; + DetDAP det = { + s = \\g,c => det.s ! False ! g ! c ; -- HL 7/22 todo: check + sp = \\g,c => det.sp ! False ! g ! c ; + n = det.n ; a = det.a ; isDef = det.isDef ; hasDefArt = det.hasDefArt + } ; QuantityNP dig m = { s = \\_,c => preOrPost m.isPre m.s (dig.s ! invNum) ; @@ -262,4 +261,12 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in { ext = "" ; } ; + QuantityFloatNP dig1 dig2 m = { + s = \\_,c => preOrPost m.isPre m.s (dig1.s ! invNum ++ BIND ++ "." ++ BIND ++ dig2.s ! invNum) ; + a = agrP3 Pl ; + w = WLight ; + rc = "" ; + ext = "" ; + } ; + } diff --git a/src/german/ParadigmsGer.gf b/src/german/ParadigmsGer.gf index e083dbd30..6190f0117 100644 --- a/src/german/ParadigmsGer.gf +++ b/src/german/ParadigmsGer.gf @@ -234,9 +234,9 @@ mkN : overload { mkPrep : Str -> Case -> Prep ; -- e.g. "durch" + accusative mkPrep : Case -> Str -> Prep ; -- postposition mkPrep : Str -> Case -> Str -> Prep ; -- both sides - -- for preposition glued with DefArt in singular: + -- for prepositions glued with DefArt in singular -- e.g. "auf" "auf den" "auf die" "aufs" + accusative - mkPrep : Str -> Str -> Str -> Str-> Case -> Prep ; + mkPrep : Str -> Str -> Str -> Str -> Case -> Prep ; mkPrep : Case -> Prep ; -- convert case to preposition } ; @@ -252,6 +252,7 @@ mkN : overload { zu_Prep : Prep ; -- zu + dative, with contractions zum, zur bei_Prep : Prep ; -- bei + dative, with contraction beim anDat_Prep : Prep ; -- an + dative, with contraction am + anAcc_Prep : Prep ; -- an + accusative, with contraction ans inDat_Prep : Prep ; -- in + dative, with contraction im inAcc_Prep : Prep ; -- in + accusative, with contraction ins aufAcc_Prep : Prep ; -- auf + accusative, with contraction aufs @@ -337,12 +338,12 @@ mkV2 : overload { -- Three-place (ditransitive) verbs need two prepositions, of which -- the first one or both can be absent. - accdatV3 : V -> V3 ; -- geben + dat(c2) + acc(c3) (Eng: no prepositions) - dirV3 : V -> Prep -> V3 ; -- senden + acc + nach (preposition on second arg) + accdatV3 : V -> V3 ; -- geben + dat(c2) + acc(c3) (Eng: give sb sth) + dirV3 : V -> Prep -> V3 ; -- senden + acc(c2) + nach(c3) mkV3 : overload { mkV3 : V -> V3 ; -- geben + dat(c3) + acc(c2) (Eng: give sth to-sb) - mkV3 : V -> Prep -> Prep -> V3 ; -- sprechen + mit + über + mkV3 : V -> Prep -> Prep -> V3 ; -- sprechen + mit(c2) + über(c3) } ; --3 Other complement patterns @@ -353,39 +354,39 @@ mkV2 : overload { mkV0 : V -> V0 ; --% mkVS : V -> VS ; - mkV2V : overload { -- with zu; object-control - mkV2V : V -> V2V ; - mkV2V : V -> Prep -> V2V ; + mkV2V : overload { -- with zu + mkV2V : V -> V2V ; -- object-control verb (zu-inf), e.g. bitte jmdn, sich auszuruhen + mkV2V : V -> Prep -> V2V ; -- object-control verb with prep, e.g. appelliere an jmdn, zu schweigen } ; auxV2V : overload { -- without zu - auxV2V : V -> V2V ; + auxV2V : V -> V2V ; -- object-control auxiliary, e.g. lasse jmdn sich ausruhen auxV2V : V -> Prep -> V2V ; } ; - subjV2V : V2V -> V2V ; -- force subject-control + subjV2V : V2V -> V2V ; -- force subject-control, e.g. verspreche jmdm, mich auszuruhen mkV2A : overload { - mkV2A : V -> V2A ; + mkV2A : V -> V2A ; -- e.g. male etwas blau mkV2A : V -> Prep -> V2A ; } ; mkV2S : overload { - mkV2S : V -> V2S ; - mkV2S : V -> Prep -> V2S ; + mkV2S : V -> V2S ; -- e.g. antworte jmdm, dass S + mkV2S : V -> Prep -> V2S ; -- e.g. berichte an jmdn, dass S } ; mkV2Q : overload { - mkV2Q : V -> V2Q ; + mkV2Q : V -> V2Q ; -- e.g. frage jmdn, ob S mkV2Q : V -> Prep -> V2Q ; } ; - mkVV : V -> VV ; -- with zu - auxVV : V -> VV ; -- without zu + mkVV : V -> VV ; -- with zu, e.g. versuche, zu schlafen + auxVV : V -> VV ; -- without zu, e.g. will schlafen mkVA : overload { - mkVA : V -> VA ; + mkVA : V -> VA ; -- e.g. bleibe gesund mkVA : V -> Prep -> VA ; } ; - mkVQ : V -> VQ ; + mkVQ : V -> VQ ; -- e.g. frage mich, ob S mkAS : A -> AS ; --% @@ -582,19 +583,18 @@ mkV2 : overload { mkPrep : Case -> Str -> Prep = \c,s -> {s = \\_ => [] ; s2 = s ; c = c ; isPrep = isPrep ; lock_Prep = <>} ; mkPrep : Str -> Case -> Str -> Prep = \s,c,t -> - {s = \\_ => s ; s2 = t ; c = c ; isPrep = isPrep ; lock_Prep = <>} ; - mkPrep : Str -> Str -> Str -> Str-> Case -> Prep = \s,masc,fem,neutr, c -> + {s = \\_ => s ; s2 = t ; c = c ; isPrep = isPrep ; lock_Prep = <>} ; + mkPrep : Str -> Str -> Str -> Str -> Case -> Prep = \s,masc,fem,neutr,c -> {s = table{GPl => s ; GSg Masc => masc ; GSg Fem => fem ; GSg Neutr => neutr} ; s2 = [] ; c = c ; isPrep = isPrepDefArt ; lock_Prep = <>} ; mkPrep : Case -> Prep = \c -> - {s = \\_ => [] ; s2 = [] ; c = c ; isPrep = isCase ; lock_Prep = <>} ; + {s = \\_ => [] ; s2 = [] ; c = c ; isPrep = isCase ; lock_Prep = <>} } ; - + accPrep = mkPrep accusative ; datPrep = mkPrep dative ; genPrep = mkPrep genitive ; - --von_Prep = mkPrep "von" dative ; von_Prep = mkPrep "von" "vom" "von der" "vom" dative ; zu_Prep = mkPrep "zu" "zum" "zur" "zum" dative ; bei_Prep = mkPrep "bei" "beim" "bei der" "beim" dative ; @@ -672,7 +672,7 @@ mkV2 : overload { = \v,c,d -> lin V3 (v ** {c2 = c ; c3 = d}) ; } ; - dirV3 v p = mkV3 v accPrep p ; + dirV3 v p = mkV3 v accPrep p ; -- accPrep sets isPrep=False accdatV3 v = mkV3 v datPrep accPrep ; -- to fit to Eng ditransitives (no preposition): -- give sb(indir) sth(dir) = geben jmdm(dat) etwas(acc) mkVS v = v ** {lock_VS = <>} ; diff --git a/src/german/PhraseGer.gf b/src/german/PhraseGer.gf index 36c1d4e32..28e03ae27 100644 --- a/src/german/PhraseGer.gf +++ b/src/german/PhraseGer.gf @@ -1,4 +1,3 @@ ---# -path=.:../abstract:../common:prelude -- HL concrete PhraseGer of Phrase = CatGer ** open Prelude, ResGer in { flags optimize=all_subs ; diff --git a/src/german/QuestionGer.gf b/src/german/QuestionGer.gf index e5d660fb0..547eafda7 100644 --- a/src/german/QuestionGer.gf +++ b/src/german/QuestionGer.gf @@ -14,14 +14,14 @@ concrete QuestionGer of Question = CatGer ** open ResGer in { } ; QuestVP ip vp = { - s = \\m,t,a,p => + s = \\m,t,a,p => let who = appPrep vp.c1 ip.s ; cl = (mkClause who (agrP3 ip.n) vp).s ! m ! t ! a ! p in table { - QDir => cl ! Main ; - QIndir => cl ! Sub - } + QDir => cl ! Main ; + QIndir => cl ! Sub + } } ; QuestSlash ip slash = { diff --git a/src/german/RelativeGer.gf b/src/german/RelativeGer.gf index f961cb121..48521cbb4 100644 --- a/src/german/RelativeGer.gf +++ b/src/german/RelativeGer.gf @@ -1,4 +1,4 @@ -concrete RelativeGer of Relative = CatGer ** open Prelude, ResGer in { +concrete RelativeGer of Relative = CatGer ** open ResGer, Prelude in { flags optimize=all_subs ; @@ -18,7 +18,7 @@ concrete RelativeGer of Relative = CatGer ** open Prelude, ResGer in { } ; agr = case rp.a of { RNoAg => agrP3 (numGenNum gn) ; - RAg n p => Ag Neutr n p + RAg n p => case n of {Sg => AgSgP3 Neutr ; Pl => AgPl p} } ; cl = mkClause (rp.s ! rgn ! Nom) agr vp in diff --git a/src/german/ResGer.gf b/src/german/ResGer.gf index 660b0d4e6..8273913d3 100644 --- a/src/german/ResGer.gf +++ b/src/german/ResGer.gf @@ -35,16 +35,40 @@ resource ResGer = ParamX ** open Prelude in { GenNum = GSg Gender | GPl ; RelGenNum = RGenNum GenNum | RSentence ; --- Agreement of $NP$ has three parts. +-- Agreement of $NP$ has three parts: gender, number and person. - Agr = Ag Gender Number Person ; + -- These 3*2*3 = 18 values can be reduced to 9, since gender is used only + -- in 3rd person singular. To select reflexive and possessive forms for "Sie" + -- in (mkClause str agr vp), add a value AgPlPol, for "man", use AgSgP3 Masc. HL 29.9.2023 + + Agr = AgSgP1 | AgSgP2 | AgSgP3 Gender | AgPl Person | AgPlPol ; oper - mkAgr : {g : Gender ; n : Number ; p : Person} -> Agr = \r -> - Ag r.g r.n r.p ; - genderAgr : Agr -> Gender = \r -> case r of {Ag g _ _ => g} ; - numberAgr : Agr -> Number = \r -> case r of {Ag _ n _ => n} ; - personAgr : Agr -> Person = \r -> case r of {Ag _ _ p => p} ; + genderAgr : Agr -> Gender = \r -> case r of {AgSgP3 g => g ; _ => Masc} ; + + numberAgr = overload { + numberAgr : Agr -> Number = \r -> case r of { + AgSgP1 | AgSgP2 | AgSgP3 _ => Sg ; + AgPl _ | AgPlPol => Pl + } ; + numberAgr : VAgr -> Number = \r -> case r of {VAg n _ => n} ; + } ; + personAgr = overload { + personAgr : Agr -> Person = \r -> case r of { + AgSgP1 | AgPl P1 => P1 ; + AgSgP2 | AgPl P2 => P2 ; + AgSgP3 _ | AgPl P3 | AgPlPol => P3 + } ; + personAgr : VAgr -> Person = \r -> case r of {VAg _ p => p} + } ; + + conjAgr : Agr -> Agr -> Agr = \a,b -> + let n : Number = conjNumber (numberAgr a) (numberAgr b) ; + p : Person = conjPerson (personAgr a) (personAgr b) + in case of { => AgPl p ; + => AgSgP3 Neutr ; + => AgSgP1 ; + => AgSgP2 } ; -- Pronouns are the worst-case noun phrases, which have both case -- and possessive forms. @@ -58,16 +82,14 @@ resource ResGer = ParamX ** open Prelude in { param PredetCase = NoCase | PredCase Case ; PredetAgr = PAg Number | PAgNone ; - oper noCase : {p : Str ; k : PredetCase} = {p = [] ; k = NoCase} ; -- Pronominal nps are ordered differently, and light nps come before negation in clauses. -- (To save space, reduce isPron * isLight = 4 values to the following three.) HL 9/19 - param - Weight = WPron | WLight | WHeavy | WDefArt ; -- HL: may need WIndefArt for nicht+ein => kein - oper -- to handle clause negation properly + Weight = WPron | WLight | WHeavy | WDefArt ; + oper isPron : {w : Weight} -> Bool = \np -> case np.w of {WPron => True ; _ => False} ; isLight : {w : Weight} -> Bool = \np -> @@ -82,6 +104,9 @@ resource ResGer = ParamX ** open Prelude in { --2 For $Verb$ + param VAgr = -- Gender is irrelevant for verb forms, HL 8/2023 + VAg Number Person ; -- except participles + param VForm = VInf Bool -- True = with the particle "zu" | VFin Bool VFormFin -- True = prefix glued to verb @@ -130,8 +155,10 @@ resource ResGer = ParamX ** open Prelude in { oper agrP3 : Number -> Agr = agrgP3 Neutr ; - agrgP3 : Gender -> Number -> Agr = \g,n -> - Ag g n P3 ; + agrgP3 : Gender -> Number -> Agr = \g,n -> case n of { + Sg => AgSgP3 g ; + Pl => AgPl P3 -- no gender in Pl + } ; gennum : Gender -> Number -> GenNum = \g,n -> case n of { @@ -172,10 +199,10 @@ resource ResGer = ParamX ** open Prelude in { _ => Weak } ; - vFin : Bool -> Mood -> Tense -> Agr -> VForm = \b,m,t,a -> + vFin : Bool -> Mood -> Tense -> VAgr -> VForm = \b,m,t,a -> let - an = numberAgr a ; - ap = personAgr a ; + an : Number = numberAgr a ; + ap : Person = personAgr a ; in case of { => VFin b (VPresInd an ap) ; @@ -186,11 +213,15 @@ resource ResGer = ParamX ** open Prelude in { _ => VInf False --# notpresent } ; - conjAgr : Agr -> Agr -> Agr = \a,b -> mkAgr { - g = Neutr ; ---- - n = conjNumber (numberAgr a) (numberAgr b) ; - p = conjPerson (personAgr a) (personAgr b) - } ; + agr2vagr : Agr -> VAgr = \r -> case r of { + AgSgP1 => VAg Sg P1 ; + AgSgP2 => VAg Sg P2 ; + AgSgP3 g => VAg Sg P3 ; + AgPl p => VAg Pl p ; + AgPlPol => VAg Pl P3 + } ; + + vagrP3 : Number -> VAgr = \n -> VAg n P3 ; -------------------------------------------- --TYPE DEFINITIONS + WORST-CASE CONSTRUCTORS @@ -415,51 +446,44 @@ resource ResGer = ParamX ** open Prelude in { -- To apply a preposition to a complement. appPrep : Preposition -> (Case => Str) -> Str = \prep,arg -> - prep.s ! GPl ++ arg ! prep.c ++ prep.s2 ; + prep.s ! GPl ++ arg ! prep.c ++ prep.s2 ; appPrepNP : Preposition -> NP -> Str = \prep,np -> let - g = (genderAgr np.a) ; - n = (numberAgr np.a) ; + g : Gender = genderAgr np.a ; + n : Number = numberAgr np.a ; glues = case of { => True ; _ => False} ; nps = np.s ! glues ! prep.c in case of { => -- e.g. "zum Hof|zur Tür|zum Fenster herein" prep.s ! (GSg g) ++ nps ++ np.ext ++ prep.s2 ++ np.rc ; - _ => prep.s ! GPl ++ nps ++ np.ext ++ prep.s2 ++ np.rc - } ; -{- - -- Simplify to test the effect on grammar compilation complexity (without SlashV2VNP): - -- with glues = False: 27096 msec, 3,2M VerbGer.gfo, 854K SentenceGer.gfo - -- and SlashV2VNP:102597 msec, 16 M VerbGer.gfo, 854K SentenceGer.gfo (good!) - appPrepNP : Preposition -> NP -> Str = \prep,np -> - let - glues = False ; - nps = np.s ! glues ! prep.c - in prep.s ! GPl ++ nps ++ np.ext ++ prep.s2 ++ np.rc ; + _ => prep.s ! GPl ++ nps ++ np.ext ++ prep.s2 ++ np.rc + } ; + +{- -- Simplify to test the effect on grammar compilation complexity (without SlashV2VNP): + -- with glues = False: 27096 msec, 3,2M VerbGer.gfo, 854 SentenceGer.gfo + -- and SlashV2VNP:102597 msec, 16 M VerbGer.gfo, 854 SentenceGer.gfo (good!) + appPrepNP : Preposition -> NP -> Str = \prep,np -> + let + glues = False ; + nps = np.s ! glues ! prep.c + in prep.s ! GPl ++ nps ++ np.ext ++ prep.s2 ++ np.rc ; -} + bigNP : NP -> Str = \np -> np.ext ++ np.rc ; - + +-- To build a preposition from just a case. -- HL 9/19: no longer used in RGL + + noPreposition : Case -> Preposition = \c -> + {s = \\_ => [] ; s2 = [] ; c = c ; isPrep = isCase} ; + -- To build a preposition from just a case. -- HL 9/19: moved to mkPrep in ParadigmsGer PrepNom : Preposition = {s = \\_ => []; isPrep = isCase ; c = Nom ; s2 = []} ; vonDat : Preposition = {s=table{GPl => "von" ; GSg Fem => "von der"; _ => "vom"}; s2=[]; c=Dat; isPrep=isPrepDefArt} ; - -- for testing: - Dat' : Preposition = {s = \\_ => []; s2 = []; c=Dat; isPrep=isCase} ; - mit' : Preposition = {s = \\_ => "zusammen mit"; s2 = []; c=Dat; isPrep=isPrep} ; - - zuDat' : Preposition = {s=\\_ => "zu"; s2="herein"; c=Dat; isPrep=isPrep} ; - zum' : Preposition = {s= table{GPl => "zu"; GSg Fem =>"zur"; _ => "zum"}; - s2="herein"; c=Dat; isPrep=isPrepDefArt} ; - inDat' : Preposition = {s= \\_ => "in" ; s2="drin"; c=Dat; isPrep=isPrep} ; - im' : Preposition = {s= table{GPl => "in"; GSg Fem=>"in der"; _ =>"im"}; - s2="drin"; c=Dat; isPrep=isPrepDefArt} ; - inAcc' : Preposition = {s=\\_ => "in"; s2="hinein"; c=Acc; isPrep=isPrep} ; - ins' : Preposition = {s=table{GPl => "in"; GSg Masc=>"in den"; GSg Fem=>"in die"; GSg Neutr=>"ins"}; - s2="hinein"; c=Acc; isPrep=isPrepDefArt} ; -- To build passive: accusative object -> nom subject; others -> same case or prep @@ -473,8 +497,8 @@ resource ResGer = ParamX ** open Prelude in { -- Here we define personal and relative pronouns. -- All personal pronouns, except "ihr", conform to the simple pattern $mkPronPers$. - mkPronPers : (x1,_,_,_,x5 : Str) -> Gender -> Number -> Person -> - {s : NPForm => Str ; a : Agr} = + mkPronPers : (x1,_,_,_,x5 : Str) -> Gender -> Number -> Person -> + {s : NPForm => Str ; a : Agr} = \ich,mich,mir,meiner,mein,g,n,p -> { s = table { NPCase c => caselist ich mich mir meiner ! c ; @@ -486,7 +510,12 @@ resource ResGer = ParamX ** open Prelude in { } } } ; - a = Ag g n p + a = case of { + <_,Pl,p > => AgPl p ; + => AgSgP3 g ; + <_,Sg,P1> => AgSgP1 ; + <_,Sg,P2> => AgSgP2 -- for "man", "Sie", set in StructuralGer HL + } } ; pronEnding : GenNum => Case => Str = table { @@ -503,30 +532,14 @@ resource ResGer = ParamX ** open Prelude in { GPl => caselist "die" "die" "den" "der" } ; -{- -- used in SymbolGer: - artDefContr : GenNum -> PCase -> Str = \gn,np -> case np of { - NPC c => artDef ! gn ! c ; - NPP p => case of { - => "am" ; - => "ins" ; - => "im" ; - => "zum" ; - => "zum" ; - => "zur" ; - => "vom" ; - _ => let sp = prepC np in sp.s ++ artDef ! gn ! sp.c - } - } ; --} - -- This is used when forming determiners that are like adjectives. appAdj : Adjective -> Number => Gender => Case => Str = \adj -> let - ad : GenNum -> Case -> Str = \gn,c -> + ad : GenNum -> Case -> Str = \gn,c -> adj.s ! Posit ! AMod gn c in - \\n,g,c => case n of {Sg => ad (GSg g) c ;_ => ad GPl c} ; + \\n,g,c => case n of {Sg => ad (GSg g) c ; _ => ad GPl c} ; -- This auxiliary gives the forms in each degree of adjectives. @@ -559,7 +572,7 @@ resource ResGer = ParamX ** open Prelude in { -- For $Verb$. VPC : Type = { - s : Bool => Agr => VPForm => { -- True = prefix glued to verb + s : Bool => VAgr => VPForm => { -- True = prefix glued to verb fin : Str ; -- wird inf, inf2 : Str -- lesen,[] | gelesen,haben | können,haben (= gekonnt,haben) } -- HL 11/6/2019 Fut Anter: lesen gekonnt haben => haben lesen können @@ -575,8 +588,9 @@ resource ResGer = ParamX ** open Prelude in { ext : Str ; -- sentential complement of V(2)S, V(2)Q, e.g. dass|ob sie kommt inf : {inpl: (Agr => Str)*Str ; -- infinitival complement of V(2)V HL 3/2022 extr: (Agr => Str)} ; -- e.g. ihn [] versuchen (lasse) [, ihr zu helfen] - c1 : Preposition -- case of subject + c1 : Preposition -- case of subject } ; + VPSlash = VP ** {c2 : Preposition ; objCtrl : Bool} ; -- HL 3/2019 objCtr added -- objCtrl distinguishes object-control from subject-control verb v:V2V in VP.s: @@ -587,26 +601,26 @@ resource ResGer = ParamX ** open Prelude in { let isAux = vp.isAux ; verb = vp.s ; - vfin : Bool -> Mood -> Tense -> Agr -> Str = \b,m,t,a -> + vfin : Bool -> Mood -> Tense -> VAgr -> Str = \b,m,t,a -> verb.s ! vFin b m t a ; vinf = verb.s ! VInf False ; vpart = if_then_Str isAux vinf (verb.s ! VPastPart APred) ; vHaben = auxPerfect verb ; - hat : Mood -> Tense -> Agr -> Str = \m,t,a -> + hat : Mood -> Tense -> VAgr -> Str = \m,t,a -> vHaben ! vFin False m t a ; haben : Str = vHaben ! VInf False ; - wird : Mood -> Agr -> Str = \m,a -> + wird : Mood -> VAgr -> Str = \m,a -> let - an = numberAgr a ; - ap = personAgr a ; + an : Number = numberAgr a ; + ap : Person = personAgr a ; in case m of { - MIndic => werden_V.s ! VFin False (VPresInd an ap) ; + MIndic => werden_V.s ! VFin False (VPresInd an ap) ; MConjunct => werden_V.s ! VFin False (VPresSubj an ap) - } ; - wuerde : Agr -> Str = \a -> --# notpresent + } ; + wuerde : VAgr -> Str = \a -> --# notpresent werden_V.s ! VFin False (VImpfSubj (numberAgr a) (personAgr a)) ; --# notpresent auf = verb.prefix ; @@ -759,10 +773,9 @@ resource ResGer = ParamX ** open Prelude in { } } ; -- the ordering of objects of v:V3 (and v:V4) is also determined by Slash?V3 (and Slash?V4) - insertObjRefl : VPSlash -> VPSlash = \vp -> -- HL 6/2019, to order reflPron < neg < prep+reflPron - let prep = vp.c2 ; -- HL 7/22 reduced to c:Case - obj : Agr => Str = \\a => prep.s ! GPl ++ reflPron ! a ! prep.c ++ prep.s2 ; + let prep = vp.c2 ; + obj : Agr => Str = \\a => prep.s ! GPl ++ reflPron ! a ! prep.c ++ prep.s2 in vp ** { nn = \\a => let vpnn = vp.nn ! a in @@ -837,14 +850,15 @@ resource ResGer = ParamX ** open Prelude in { } ; mkClause : Str -> Agr -> VP -> Clause = \subj,agr,vp -> - let vps = useVP vp in { + let vagr = agr2vagr agr ; + 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 ; + verb = vps.s ! ord ! vagr ! VPFinite m t a ; haben = verb.inf2 ; neg = negation ! b ; obj1 = (vp.nn ! agr).p1 ++ (vp.nn ! agr).p2 ; -- refl ++ pronouns ++ light nps @@ -912,7 +926,7 @@ resource ResGer = ParamX ** open Prelude in { in < \\agr => (vp.nn ! agr).p1 ++ (vp.nn ! agr).p2 ++ (vp.nn ! agr).p3 ++ (vp.nn ! agr).p4 ++ vp.a2, - vp.a1 ++ vp.adj ++ (vps.s ! (notB isAux) ! agrP3 Sg ! VPInfinit Simul).inf, -- vp.a1 ! Pos + vp.a1 ++ vp.adj ++ (vps.s ! (notB isAux) ! vagrP3 Sg ! VPInfinit Simul).inf, -- vp.a1 ! Pos vp.inf.inpl.p2, -- ! HL infExt ++ vp.ext > ; @@ -923,7 +937,7 @@ resource ResGer = ParamX ** open Prelude in { { objs = \\agr => (vp.nn ! agr).p1 ++ (vp.nn ! agr).p2 ++ negation ! pol ++ (vp.nn ! agr).p3 ++ vp.a2 ++ (vp.nn ! agr).p4 ; -- objects + predicative A|CN|NP - pred = vp.a1 ++ vp.adj ++ (vps.s ! (notB isAux) ! agrP3 Sg ! VPInfinit ant).inf ; + pred = vp.a1 ++ vp.adj ++ (vps.s ! (notB isAux) ! vagrP3 Sg ! VPInfinit ant).inf ; -- inplace and extracted parts of vp.inf: inpl = vp.inf.inpl ; extr = vp.inf.extr @@ -934,7 +948,7 @@ resource ResGer = ParamX ** open Prelude in { \isAux, ant, pol, vp -> let vps = useVP vp in { objs = \\agr => (vp.nn ! agr).p1 ++ (vp.nn ! agr).p2 ++ negation ! pol ++ (vp.nn ! agr).p3 ++ vp.a2 ++ (vp.nn ! agr).p4 ; -- objects + predicative A|CN|NP - pred = vp.inf.inpl.p2 ++ vp.a1 ++ vp.adj ++ (vps.s ! (notB isAux) ! agrP3 Sg ! VPInfinit ant).inf ; + pred = vp.inf.inpl.p2 ++ vp.a1 ++ vp.adj ++ (vps.s ! (notB isAux) ! vagrP3 Sg ! VPInfinit ant).inf ; -- inplace and extracted parts of vp.inf: inpl = ; -- move the predicate part to pred extr = vp.inf.extr @@ -945,55 +959,67 @@ resource ResGer = ParamX ** open Prelude in { -- let vpi = infVP isAux vp in -- vpi.p1 ! agrP3 Sg ++ vpi.p3 ++ vpi.p2 ++ vpi.p4 ; let vpi = infVP isAux Simul Pos vp ; -- HL 3/2022 - agr : Agr = (Ag Masc Sg P3) ; - glue : (Agr => Str)*Str -> Str = \i -> i.p1!agr ++ i.p2 + agr = agrP3 Sg ; + glue : (Agr => Str)*Str -> Str = \i -> i.p1 ! agr ++ i.p2 in glue (embedInf vpi.inpl ) ++ vpi.extr!agr ++ vp.ext ; -- The nominative case is not used as reflexive, but defined here -- so that we can reuse this in personal pronouns. - reflPron : Agr => Case => Str = table { - Ag _ Sg P1 => caselist "ich" "mich" "mir" "meiner" ; - Ag _ Sg P2 => caselist "du" "dich" "dir" "deiner" ; - Ag Masc Sg P3 => caselist "er" "sich" "sich" "seiner" ; - Ag Fem Sg P3 => caselist "sie" "sich" "sich" "ihrer" ; - Ag Neutr Sg P3 => caselist "es" "sich" "sich" "seiner" ; - Ag _ Pl P1 => caselist "wir" "uns" "uns" "unser" ; - Ag _ Pl P2 => caselist "ihr" "euch" "euch" "euer" ; - Ag _ Pl P3 => caselist "sie" "sich" "sich" "ihrer" + reflPron : Agr => Case => Str = table { -- with persPron nominative + AgSgP1 => caselist "ich" "mich" "mir" "meiner" ; + AgSgP2 => caselist "du" "dich" "dir" "deiner" ; + AgSgP3 Masc => caselist "er" "sich" "sich" "seiner" ; + AgSgP3 Fem => caselist "sie" "sich" "sich" "ihrer" ; + AgSgP3 Neutr => caselist "es" "sich" "sich" "seiner" ; + AgPl P1 => caselist "wir" "uns" "uns" "unser" ; + AgPl P2 => caselist "ihr" "euch" "euch" "euer" ; + AgPl P3 => caselist "sie" "sich" "sich" "ihrer" ; + AgPlPol => caselist "Sie" "sich" "sich" "Ihrer" -- HL 8/2023 + -- AgSgP3Gen => caselist "man selbst" "sich" "sich" "seiner" ; -- älter als man selbst sein + -- ; AgPlReci => caselist "man" "einander" "einander" "einander" -- reciPron ? } ; possPron : Agr -> Number -> Gender -> Case -> Str = \a,n,g,c -> case of { - => caselist "mein" "meinen" "meinem" "meines" ! c ; - => caselist "meine" "meine" "meiner" "meiner" ! c ; - => caselist "mein" "mein" "meinem" "meines" ! c ; - => caselist "meine" "meine" "meinen" "meiner" ! c ; - => caselist "dein" "deinen" "deinem" "deines" ! c ; - => caselist "deine" "deine" "deiner" "deiner" ! c ; - => caselist "dein" "dein" "deinem" "deines" ! c ; - => caselist "deine" "deine" "deinen" "deiner" ! c ; - - => caselist "sein" "seinen" "seinem" "seines" ! c ; - => caselist "seine" "seine" "seiner" "seiner" ! c ; - => caselist "sein" "sein" "seinem" "seines" ! c ; - => caselist "seine" "seine" "seinen" "seiner" ! c ; + => caselist "mein" "meinen" "meinem" "meines" ! c ; + => caselist "meine" "meine" "meiner" "meiner" ! c ; + => caselist "mein" "mein" "meinem" "meines" ! c ; + => caselist "meine" "meine" "meinen" "meiner" ! c ; + => caselist "dein" "deinen" "deinem" "deines" ! c ; + => caselist "deine" "deine" "deiner" "deiner" ! c ; + => caselist "dein" "dein" "deinem" "deines" ! c ; + => caselist "deine" "deine" "deinen" "deiner" ! c ; - => caselist "ihr" "ihren" "ihrem" "ihres" ! c ; - => caselist "ihre" "ihre" "ihrer" "ihrer" ! c ; - => caselist "ihr" "ihr" "ihrem" "ihres" ! c ; - => caselist "ihre" "ihre" "ihren" "ihrer" ! c ; + => caselist "ihr" "ihren" "ihrem" "ihres" ! c ; + => caselist "ihre" "ihre" "ihrer" "ihrer" ! c ; + => caselist "ihr" "ihr" "ihrem" "ihres" ! c ; + => caselist "ihre" "ihre" "ihren" "ihrer" ! c ; - => caselist "unser" "unseren" "unserem" "unseres" ! c ; - => caselist "unsere" "unsere" "unserer" "unserer" ! c ; - => caselist "unser" "unser" "unserem" "unseres" ! c ; - => caselist "unsere" "unsere" "unseren" "unserer" ! c ; - - => caselist "euer" "euren" "eurem" "eures" ! c ; - => caselist "eure" "eure" "eurer" "eurer" ! c ; - => caselist "euer" "euer" "eurem" "eures" ! c ; - => caselist "eure" "eure" "euren" "eurer" ! c - + => caselist "sein" "seinen" "seinem" "seines" ! c ; + => caselist "seine" "seine" "seiner" "seiner" ! c ; + => caselist "sein" "sein" "seinem" "seines" ! c ; + => caselist "seine" "seine" "seinen" "seiner" ! c ; + + => caselist "unser" "unseren" "unserem" "unseres" ! c ; + => caselist "unsere" "unsere" "unserer" "unserer" ! c ; + => caselist "unser" "unser" "unserem" "unseres" ! c ; + => caselist "unsere" "unsere" "unseren" "unserer" ! c ; + + => caselist "euer" "euren" "eurem" "eures" ! c ; + => caselist "eure" "eure" "eurer" "eurer" ! c ; + => caselist "euer" "euer" "eurem" "eures" ! c ; + => caselist "eure" "eure" "euren" "eurer" ! c ; + + => caselist "ihr" "ihren" "ihrem" "ihres" ! c ; + => caselist "ihre" "ihre" "ihrer" "ihrer" ! c ; + => caselist "ihr" "ihr" "ihrem" "ihres" ! c ; + => caselist "ihre" "ihre" "ihren" "ihrer" ! c ; + + => caselist "Ihr" "Ihren" "Ihrem" "Ihres" ! c ; + => caselist "Ihre" "Ihre" "Ihrer" "Ihrer" ! c ; + => caselist "Ihr" "Ihr" "Ihrem" "Ihres" ! c ; + => caselist "Ihre" "Ihre" "Ihren" "Ihrer" ! c } ; conjThat : Str = "dass" ; @@ -1022,11 +1048,10 @@ resource ResGer = ParamX ** open Prelude in { } ; -- Function that allows the construction of non-nominative subjects. - mkSubject : NP -> Preposition -> {s:Str ; a:Agr} = \np, prep -> let - subj = appPrepNP prep np ; - agr = case prep.c of { Nom => np.a ; _ => Ag Masc Sg P3 } + agr = case prep.c of { Nom => np.a ; _ => AgSgP3 Masc } ; + subj = appPrepNP prep np in {s = subj ; a = agr} ; sex2gender : Sex -> Gender = \g -> diff --git a/src/german/SentenceGer.gf b/src/german/SentenceGer.gf index 353256a64..04247b7b8 100644 --- a/src/german/SentenceGer.gf +++ b/src/german/SentenceGer.gf @@ -21,17 +21,23 @@ concrete SentenceGer of Sentence = CatGer ** open ResGer, Prelude in { s = \\pol,n => let ps = case n of { - ImpF _ True => ; -- setzen Sie sich - _ => - } ; - agr = Ag Fem (numImp n) ps.p1 ; --- g does not matter - verb = vps.s ! False ! agr ! VPImperat ps.p3 ; + ImpF _ True => ; -- setzen Sie sich Ihren Hut auf + _ => -- but: nimm [ihren | deinen | *Ihren] Hut + } ; -- vp should be reflexive, ComplRSlash + vagr = VAg (numImp n) ps.p1 ; + verb = vps.s ! False ! vagr ! VPImperat ps.p3 ; + agr = case of { + <_, P3,True> => AgPlPol ; -- sich | Ihr- + => AgSgP2 ; -- dich | dein- + => AgPl P2 ; -- euch | euer- + _ => AgSgP1 -- default, does not occur + } ; neg = negation ! pol ; inf = vp.inf.inpl.p2 ++ verb.inf ; -- HL .s/.inpl.p2 obj = (vp.nn ! agr).p2 ++ (vp.nn ! agr).p3 ++ (vp.nn ! agr).p4 ++ vp.adj in verb.fin ++ ps.p2 ++ (vp.nn ! agr).p1 ++ vp.a1 ++ neg ++ obj ++ vp.a2 ++ inf ++ vp.ext - } ; + } ; AdvImp adv imp = { s = \\pol,impform => adv.s ++ imp.s ! pol ! impform @@ -42,9 +48,9 @@ concrete SentenceGer of Sentence = CatGer ** open ResGer, Prelude in { -- + SlashVP 414720 (28224,204) SlashVP np vp = - let subj = mkSubject np vp.c1 ; -- HL 3/2022: need a mkClSlash to prevent - in mkClause subj.s subj.a vp ** { c2 = vp.c2 } ; -- reflexives in vp instantiated to np.a - -- cf. tests/german/TestLangGer.gf + let subj = mkSubject np vp.c1 ; -- HL 3/2022: need a mkClSlash to prevent + in mkClause subj.s subj.a 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 @@ -54,7 +60,7 @@ concrete SentenceGer of Sentence = CatGer ** open ResGer, Prelude in { SlashVS np vs slash = let subj = mkSubject np PrepNom ; - vp = (insertExtrapos (conjThat ++ slash.s ! Sub) (predV vs)) + vp = insertExtrapos (conjThat ++ slash.s ! Sub) (predV vs) in mkClause subj.s subj.a vp ** {c2 = slash.c2} ; EmbedS s = {s = conjThat ++ s.s ! Sub} ; -- no leading comma, if sentence-initial diff --git a/src/german/StructuralGer.gf b/src/german/StructuralGer.gf index 3c64a7d62..2e52ad833 100644 --- a/src/german/StructuralGer.gf +++ b/src/german/StructuralGer.gf @@ -1,4 +1,4 @@ -concrete StructuralGer of Structural = CatGer ** +concrete StructuralGer of Structural = CatGer ** open MorphoGer, MakeStructuralGer, (X = ConstructX), (P = ParadigmsGer), IrregGer, Prelude, (R = ResGer) in { @@ -52,13 +52,13 @@ concrete StructuralGer of Structural = CatGer ** if_Subj = ss "wenn" ; --- no variants in the RGL! | ss "falls" ; in8front_Prep = mkPrep "vor" P.dative ; i_Pron = mkPronPers "ich" "mich" "mir" "meiner" "mein" Masc Sg P1 ; --- in_Prep = mkPrep [] (NPP CInDat) ; - in_Prep = P.inDat_Prep ; -- HL 7/2022 + in_Prep = P.inDat_Prep ; it_Pron = mkPronPers "es" "es" "ihm" "seiner" "sein" Neutr Sg P3 ; less_CAdv = X.mkCAdv "weniger" "als" ; many_Det = let tab = (detLikeAdj False Pl "viel").s in {s,sp = asQuant tab ; n = Pl ; a = Weak ; isDef = False ; hasDefArt = False} ; more_CAdv = X.mkCAdv "mehr" "als" ; +-- 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 ; adj = (P.mkA "viel" "mehr" "meiste").s ! Superl @@ -67,7 +67,7 @@ concrete StructuralGer of Structural = CatGer ** c = {p = [] ; k = PredCase Gen} ; a = PAg Pl} ; much_Det = {s = asQuant (\\_,_ => "viel") ; sp = asQuant (\\_,_ => "vieles") ; - n = Sg ; a = Weak ; isDef = False ; hasDefArt = False} ; + n = Sg ; a = Weak ; isDef = False ; hasDefArt = False} ; must_VV = auxVV (mkV "müssen" "muss" "musst" "muss" "müsst" "müss" @@ -81,26 +81,27 @@ concrete StructuralGer of Structural = CatGer ** on_Prep = mkPrep "auf" P.dative ; or_Conj = {s1 = [] ; s2 = "oder" ; n = Sg} ; otherwise_PConj = ss "sonst" ; - part_Prep = P.von_Prep ; -- obsolete, use PartNP cn np + part_Prep = P.von_Prep ; -- obsolete, better use PartNP cn np please_Voc = ss "bitte" ; - possess_Prep = P.von_Prep ; -- obsolete, use PossNP cn np + possess_Prep = P.von_Prep ; -- obsolete, better use PossNP cn np quite_Adv = ss "ziemlich" ; she_Pron = mkPronPers "sie" "sie" "ihr" "ihrer" "ihr" Fem Sg P3 ; so_AdA = ss "so" ; somebody_NP = nameNounPhrase Masc {s = caselist "jemand" "jemanden" "jemandem" "jemands"} ; somePl_Det = let tab = (detLikeAdj True Pl "einig").s - in {s,sp = asQuant tab ; isDef = True ; n = Pl ; a = Weak ; hasDefArt = False} ; + in {s,sp = asQuant tab ; n = Pl ; a = Weak ; isDef = True ; hasDefArt = False} ; someSg_Det = { s,sp = asQuant (\\g,c => "ein" + pronEnding ! GSg g ! c) ; ---- einer,eines n = Sg ; a = Strong ; hasNum = True ; - isDef = False ; hasDefArt = False + isDef = False ; + hasDefArt = False } ; something_NP = nameNounPhrase Neutr {s = \\_ => "etwas"} ; somewhere_Adv = ss "irgendwo" ; that_Quant = let - jener : Number => Gender => Case => Str = \\n => (detUnlikeAdj True n "jen").s in + jener : Number => Gender => Case => Str = \\n => (detUnlikeAdj True n "jen").s in {s,sp = \\_,_ => jener ; a,aPl = Weak ; hasDefArt = False} ; ---b that_NP = nameNounPhrase Neutr {s = caselist "das" "das" "dem" "dessen"} ; ---- there_Adv = ss "da" ; --- no variants in the rgl | ss "dort" ; @@ -110,7 +111,7 @@ concrete StructuralGer of Structural = CatGer ** ---b these_NP = {s = caselist "diese" "diese" "diesen" "dieser" ; a = agrP3 Pl} ; they_Pron = mkPronPers "sie" "sie" "ihnen" "ihrer" "ihr" Fem Pl P3 ; this_Quant = let - dieser : Number => Gender => Case => Str = \\n => (detUnlikeAdj True n "dies").s in + dieser : Number => Gender => Case => Str = \\n => (detUnlikeAdj True n "dies").s in {s,sp = \\_,_ => dieser ; a,aPl = Weak ; hasDefArt = False} ; ---b this_NP = nameNounPhrase Neutr {s = caselist "dies" "dies" "diesem" "dieses"} ; ---- ---b those_NP = {s = caselist "jene" "jene" "jenen" "jener" ; a = agrP3 Pl} ; @@ -142,7 +143,7 @@ concrete StructuralGer of Structural = CatGer ** with_Prep = mkPrep "mit" P.dative ; youSg_Pron = mkPronPers "du" "dich" "dir" "deiner" "dein" Fem Sg P2 ; youPl_Pron = mkPronPers "ihr" "euch" "euch" "eurer" "euer" Fem Pl P2 ; ---- poss - youPol_Pron = mkPronPers "Sie" "Sie" "Ihnen" "Ihrer" "Ihr" Fem Pl P3 ; + youPol_Pron = mkPronPers "Sie" "Sie" "Ihnen" "Ihrer" "Ihr" Fem Pl P3 ** {a = AgPlPol} ; yes_Utt = ss "ja" ; not_Predet = {s = \\_,_,_ => "nicht" ; c = noCase ; a = PAgNone} ; @@ -168,15 +169,14 @@ concrete StructuralGer of Structural = CatGer ** lin language_title_Utt = ss "Deutsch" ; - oper - asQuant : (Gender => Case => Str) -> (Bool => Gender => Case => Str) = - \tab -> \\_,g,c => tab ! g ! c ; - asNum : (Gender => Case => Str) -> (Gender => Case => {quant,num:Str}) = - \tab -> \\g,c => {quant = []; num = tab ! g ! c} ; - pairTable : (Gender => Case => Str) -> (Gender => Case => Str) -> (Gender => Case => {quant,num:Str}) - = \qt,nt -> \\g,c => {quant = qt ! g ! c; num = nt ! g ! c} ; - - appAdjDegAdjf : Adjective -> Degree -> Adjf -> Number => Gender => Case => Str = - \adj,deg,adjf -> \\n,g,c => adj.s ! deg ! (agrAdj g adjf n c) ; +oper + asQuant : (Gender => Case => Str) -> (Bool => Gender => Case => Str) = + \tab -> \\_,g,c => tab ! g ! c ; + asNum : (Gender => Case => Str) -> (Gender => Case => {quant,num:Str}) = + \tab -> \\g,c => {quant = []; num = tab ! g ! c} ; + pairTable : (Gender => Case => Str) -> (Gender => Case => Str) -> (Gender => Case => {quant,num:Str}) + = \qt,nt -> \\g,c => {quant = qt ! g ! c; num = nt ! g ! c} ; + appAdjDegAdjf : Adjective -> Degree -> Adjf -> Number => Gender => Case => Str = + \adj,deg,adjf -> \\n,g,c => adj.s ! deg ! (agrAdj g adjf n c) ; } diff --git a/src/german/SymbolGer.gf b/src/german/SymbolGer.gf index d1c6da492..42b224321 100644 --- a/src/german/SymbolGer.gf +++ b/src/german/SymbolGer.gf @@ -9,7 +9,7 @@ lin NumPN i = {s = i.s ! Neutr ; g = Neutr ; n = Sg} ; --- c CNIntNP cn i = { - s = \\b,c => cn.s ! Weak ! Sg ! Nom ++ i.s ; + s = \\_,c => cn.s ! Weak ! Sg ! Nom ++ i.s ; a = agrP3 Sg ; w = WLight ; ext,rc = [] -- added @@ -21,11 +21,11 @@ lin ext,rc = [] -- added } ; CNNumNP cn i = { --- s = \\c => artDefContr (GSg cn.g) c ++ cn.s ! Weak ! Sg ! Nom ++ i.s ! Neutr ! c ; - s = \\_,c => artDef ! (GSg cn.g) ! c ++ cn.s ! Weak ! Sg ! Nom ++ i.s ! Neutr ! c ; -- HL 8/22 ad hoc - a = agrP3 Sg ; - w = WLight ; - ext,rc = [] + s = \\b,c => case b of {True => [] ; False => artDef ! (GSg cn.g) ! c} + ++ cn.s ! Weak ! Sg ! Nom ++ i.s ! Neutr ! c ; + a = agrgP3 cn.g Sg ; -- HL 27.9.2023 + w = WDefArt ; -- im Haus 14 + ext,rc = [] -- added } ; SymbS sy = {s = \\_ => sy.s} ; diff --git a/src/german/VerbGer.gf b/src/german/VerbGer.gf index f397ecf72..f24dda48a 100644 --- a/src/german/VerbGer.gf +++ b/src/german/VerbGer.gf @@ -21,14 +21,13 @@ concrete VerbGer of Verb = CatGer ** open Prelude, ResGer, Coordination in { SlashV2a v = (predVc v) ; - Slash2V3 v np = insertObjNP np v.c2 (predVc v) ** {c2 = v.c3} ; - Slash3V3 v np = insertObjNP np v.c3 (predVc v) ; + Slash2V3 v np = insertObjNP np v.c2 (predVc v) ** {c2 = v.c3} ; + Slash3V3 v np = insertObjNP np v.c3 (predVc v) ; SlashV2S v s = insertExtrapos (comma ++ conjThat ++ s.s ! Sub) (predV v) ** {c2 = v.c2; objCtrl = False} ; SlashV2Q v q = insertExtrapos (comma ++ q.s ! QIndir) (predV v) ** {c2 = v.c2; objCtrl = False} ; - SlashV2V v vp = -- (jmdn) bitten, sich zu waschen | sich waschen lassen HL 7/19 let vps = predVGen v.isAux v ; -- e.g. verspricht|bittet.isAux=False | läßt.isAux=True @@ -40,14 +39,12 @@ concrete VerbGer of Verb = CatGer ** open Prelude, ResGer, Coordination in { SlashV2A v ap = insertAdj (ap.s ! APred) ap.c ap.ext (predV v) ** {c2 = v.c2; objCtrl = False} ; --- to save (83669 - 67299 = 16370 msec) compile time, comment out: ComplSlash vps np = -- IL 24/04/2018 force reflexive in the VPSlash to take the agreement of np. -- HL 3/22 better before inserting np, using objCtrl let vp = case vps.objCtrl of { True => objAgr np vps ; _ => vps } ** { c2 = vps.c2 ; objCtrl = vps.objCtrl } ; in insertObjNP np vps.c2 vp ; - -- compiler: + ComplSlash' 414720 (199680,352) -- SlashVV v vps is like ComplVV v vp, but infinite vps should not be extracted SlashVV v vp = -- HL 3/2022 @@ -92,17 +89,18 @@ concrete VerbGer of Verb = CatGer ** open Prelude, ResGer, Coordination in { -- expensive: + SlashV2VNP 503.884.800 (2880,540), reaches memory limit with SlashVV -- does not work for nested uses: the nn-levels are confused HL 3/22 - -- to save a lot compile time and memory, avoid insertObjNP with glueing of prep+DefArt: - SlashV2VNP v np vp = -- bitte ihn, zu kaufen | lasse ihn kaufen HL 3/22 - -- insertObjNP np v.c2 (ComplVV v vp ** {c2 = vp.c2 ; objCtrl = vp.objCtrl}) ; - let prep = v.c2 ; - obj = appPrep prep (np.s!False) ; -- simplify: no glueing of prep+DefArt, HL 8/22 - b : Bool = case prep.isPrep of {isPrep | isPrepDefArt => True ; _ => False} ; - c = prep.c ; - w = np.w ; - vps = (ComplVV v vp ** {c2 = vp.c2 ; objCtrl = vp.objCtrl}) - in - insertObj' obj b w c vps ; + -- to save a lot compile time and memory, avoid insertObjNP with glueing of prep+DefArt: + -- + SlashV2VNP 110.592.000 (46080,240) + SlashV2VNP v np vp = -- bitte ihn, zu kaufen | lasse ihn kaufen HL 3/22 + -- insertObjNP np v.c2 (ComplVV v vp ** {c2 = vp.c2 ; objCtrl = vp.objCtrl}) ; + let prep = v.c2 ; + obj = appPrep prep (np.s!False) ; -- simplify: no glueing of prep+DefArt, HL 8/22 + b : Bool = case prep.isPrep of {isPrep | isPrepDefArt => True ; _ => False} ; + c = prep.c ; + w = np.w ; + vps = (ComplVV v vp ** {c2 = vp.c2 ; objCtrl = vp.objCtrl}) + in + insertObj' obj b w c vps ; UseComp comp = insertExtrapos comp.ext (insertObj comp.s (predV sein_V)) ; -- agr not used @@ -130,8 +128,7 @@ concrete VerbGer of Verb = CatGer ** open Prelude, ResGer, Coordination in { AdvVPSlash vp adv = vp ** insertAdv adv.s vp ; AdVVPSlash adv vp = vp ** insertAdv adv.s vp ; - -- ReflVP vp = insertObj (\\a => appPrep vp.c2 - -- (\\k => usePrepC k (\c -> reflPron ! a ! c))) vp ; + -- ReflVP vp = insertObj (\\a => appPrep vp.c2 (reflPron ! a)) vp ; ReflVP vp = insertObjRefl vp ; -- HL, 19/06/2019 PassV2 v = -- acc object -> nom subject; all others: same PCase