From e2ce9de5039c2dedfe6e1ce7dd63fdb5fea490bd Mon Sep 17 00:00:00 2001 From: Hans Leiss Date: Sat, 5 Aug 2023 18:01:03 +0200 Subject: [PATCH] Conflicts with preposition and defart resolved --- src/german/DocumentationGerFunctor.gf | 2 +- src/german/ExtraGer.gf | 36 +++++++++++++-------------- src/german/NamesGer.gf | 10 ++++---- src/german/NounGer.gf | 4 +-- src/german/ParadigmsGer.gf | 14 +++++++---- src/german/ResGer.gf | 4 +-- src/german/StructuralGer.gf | 9 +++---- 7 files changed, 41 insertions(+), 38 deletions(-) diff --git a/src/german/DocumentationGerFunctor.gf b/src/german/DocumentationGerFunctor.gf index eedea374e..3ba7ff383 100644 --- a/src/german/DocumentationGerFunctor.gf +++ b/src/german/DocumentationGerFunctor.gf @@ -163,7 +163,7 @@ oper let vfin : VForm -> Str = \f -> verb.s ! f ++ verb.prefix ; - gforms : Number -> Person -> Str = \n,p -> + gforms : ParadigmsGer.Number -> Person -> Str = \n,p -> td (vfin (VFin False (VPresInd n p))) ++ td (vfin (VFin False (VPresSubj n p))) ++ td (vfin (VFin False (VImpfInd n p))) --# notpresent diff --git a/src/german/ExtraGer.gf b/src/german/ExtraGer.gf index 4994c87aa..c884dd8b8 100644 --- a/src/german/ExtraGer.gf +++ b/src/german/ExtraGer.gf @@ -210,36 +210,36 @@ concrete ExtraGer of ExtraGerAbs = CatGer ** 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} ; + d = case pred.c.k of {NoCase => c ; PredCase k => k} ; 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} ; + 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 ! (NPC c) - ++ appPrepC prep (rnp.s ! a) ++ rnp.ext ++ rnp.rc ; + AdvRNP np prep rnp = {s = \\a,c => np.s ! False ! 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 = appPrepC prep (rnp.s ! agrP3 Sg) ; -- bug: fixed agreement + 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 = appPrepC adj.c2 (rnp.s ! agrP3 Sg) ; -- we use a fixed agreement + 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>} ; + c = case adj.c2.isPrep of {isCase => ; _ => <[], 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) ; + (N.PossNP cn (lin NP {s = \\_,c => rnp.s ! pron.a ! c ; a = pron.a ; w = WLight ; ext = rnp.ext ; @@ -253,11 +253,11 @@ concrete ExtraGer of ExtraGerAbs = CatGer ** ** {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} ; + 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 ! (NPC c) ++ x.ext ++ x.rc} 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" ; @@ -269,16 +269,16 @@ concrete ExtraGer of ExtraGerAbs = CatGer ** 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 + c = case prep.isPrep of { isCase => prep.c ; _ => 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 => 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 + => ; -- pronoun switch: + => ; -- accPron < pron + => ; -- < non-pron nominal + <_,_,_> => } -- or prepositional } ; -- SS: implementation of some of the relevant Foc rules from Extra diff --git a/src/german/NamesGer.gf b/src/german/NamesGer.gf index d7d35f2f6..8572e01b1 100644 --- a/src/german/NamesGer.gf +++ b/src/german/NamesGer.gf @@ -1,35 +1,35 @@ concrete NamesGer of Names = CatGer ** open ResGer in { lin GivenName gn = { - s = \\c => usePrepC c (\k -> gn.s ! k) ; + s = \\_,c => gn.s ! c ; a = agrgP3 (sex2gender gn.g) Sg ; w = WLight ; rc, ext = [] } ; lin MaleSurname sn = { - s = \\c => usePrepC c (\k -> sn.s ! Male ! k) ; + s = \\_,c => sn.s ! Male ! c ; a = agrgP3 Masc Sg ; w = WLight ; rc, ext = [] } ; lin FemaleSurname sn = { - s = \\c => usePrepC c (\k -> sn.s ! Female ! k) ; + s = \\_,c => sn.s ! Female ! c ; a = agrgP3 Fem Sg ; w = WLight ; rc, ext = [] } ; lin PlSurname sn = { - s = \\c => usePrepC c (\k -> sn.s ! Male ! k) ; + s = \\_,c => sn.s ! Male ! c ; a = agrgP3 Masc Pl ; w = WLight ; rc, ext = [] } ; lin FullName gn sn = { - s = \\c => usePrepC c (\k -> gn.s ! Nom ++ sn.s ! gn.g ! k) ; + s = \\_,c => gn.s ! Nom ++ sn.s ! gn.g ! c ; a = agrgP3 (sex2gender gn.g) Sg ; w = WLight ; rc, ext = [] diff --git a/src/german/NounGer.gf b/src/german/NounGer.gf index 7a83fb32f..1c23b66a7 100644 --- a/src/german/NounGer.gf +++ b/src/german/NounGer.gf @@ -266,7 +266,7 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in { QuantityNP dig m = { - s = \\c => preOrPost m.isPre m.s (dig.s ! invNum) ; + s = \\_,c => preOrPost m.isPre m.s (dig.s ! invNum) ; a = agrP3 Pl ; w = WLight ; rc = "" ; @@ -274,7 +274,7 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in { } ; QuantityFloatNP dig1 dig2 m = { - s = \\c => preOrPost m.isPre m.s (dig1.s ! invNum ++ BIND ++ "." ++ BIND ++ dig2.s ! invNum) ; + s = \\_,c => preOrPost m.isPre m.s (dig1.s ! invNum ++ BIND ++ "." ++ BIND ++ dig2.s ! invNum) ; a = agrP3 Pl ; w = WLight ; rc = "" ; diff --git a/src/german/ParadigmsGer.gf b/src/german/ParadigmsGer.gf index 7a7da6509..2190f3abe 100644 --- a/src/german/ParadigmsGer.gf +++ b/src/german/ParadigmsGer.gf @@ -382,16 +382,20 @@ mkV2 : overload { -- The definitions should not bother the user of the API. So they are -- hidden from the document. - - Gender = MorphoGer.Gender ; Case = MorphoGer.Case ; Number = MorphoGer.Number ; + masculine = Masc ; feminine = Fem ; - neuter = Neutr ; - male = Male ; - female = Female ; + neuter = Neutr ; + male = Male ; + female = Female ; + + nominative = Nom ; + accusative = Acc ; + dative = Dat ; + genitive = Gen ; singular = Sg ; plural = Pl ; diff --git a/src/german/ResGer.gf b/src/german/ResGer.gf index 76dea3bad..32e1f9dea 100644 --- a/src/german/ResGer.gf +++ b/src/german/ResGer.gf @@ -234,7 +234,7 @@ resource ResGer = ParamX ** open Prelude in { 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 ...] a : Agr ; - w : Weight } ; -- light NPs come before negation in simple clauses (expensive) + w : Weight } ; -- light NPs come before negation in simple clauses mkN : (x1,_,_,_,_,x6,x7 : Str) -> Gender -> Noun = \Mann, Mannen, Manne, Mannes, Maenner, Maennern, Mann_, g -> { @@ -466,7 +466,7 @@ resource ResGer = ParamX ** open Prelude in { subjPrep : Preposition -> Preposition = \prep -> case of { - => prep ** {c = NPC Nom} ; + => prep ** {c = Nom} ; _ => prep } ; diff --git a/src/german/StructuralGer.gf b/src/german/StructuralGer.gf index fcb8e24e0..85be4baa9 100644 --- a/src/german/StructuralGer.gf +++ b/src/german/StructuralGer.gf @@ -61,11 +61,10 @@ concrete StructuralGer of Structural = CatGer ** more_CAdv = X.mkCAdv "mehr" "als" ; 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)} ; + R.artDef ! gn ! c ++ adj ! (agrAdj g Weak n c) ; + c = {p = [] ; k = PredCase Gen} ; a = PAg Pl} ; much_Det = {s = asQuant (\\_,_ => "viel") ; sp = asQuant (\\_,_ => "vieles") ; n = Sg ; a = Weak ; isDef = False ; hasDefArt = False} ; @@ -178,7 +177,7 @@ concrete StructuralGer of Structural = CatGer ** 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 => PCase => Str = - \adj,deg,adjf -> \\n,g,c => R.usePrepC c (\k -> adj.s ! deg ! (agrAdj g adjf n k)) ; + appAdjDegAdjf : Adjective -> Degree -> Adjf -> Number => Gender => Case => Str = + \adj,deg,adjf -> \\n,g,c => adj.s ! deg ! (agrAdj g adjf n c) ; }