diff --git a/src/basque/NumeralEus.gf b/src/basque/NumeralEus.gf index 69d6cb73a..4cb1c5fb2 100644 --- a/src/basque/NumeralEus.gf +++ b/src/basque/NumeralEus.gf @@ -123,7 +123,7 @@ lin IFrac d i = { if_then_Str d.hasDot BIND (BIND++"."++BIND) ++ i.s ! co ; n = Pl ; - hasDot=False + hasDot=True } ; } diff --git a/src/estonian/NumeralEst.gf b/src/estonian/NumeralEst.gf index 712f5f123..0fb7dd316 100644 --- a/src/estonian/NumeralEst.gf +++ b/src/estonian/NumeralEst.gf @@ -157,7 +157,7 @@ oper if_then_Str d.hasDot BIND (BIND++"."++BIND) ++ i.s ! o ; n = Pl ; - hasDot=False + hasDot=True } ; oper diff --git a/src/finnish/NumeralFin.gf b/src/finnish/NumeralFin.gf index 2e136b3e3..2849304b7 100644 --- a/src/finnish/NumeralFin.gf +++ b/src/finnish/NumeralFin.gf @@ -191,7 +191,7 @@ oper if_then_Str d.hasDot BIND (BIND++"."++BIND) ++ i.s ! o ; n = Pl ; - hasDot=False + hasDot=True } ; oper diff --git a/src/german/AdjectiveGer.gf b/src/german/AdjectiveGer.gf index 9d44194d8..8f4448c78 100644 --- a/src/german/AdjectiveGer.gf +++ b/src/german/AdjectiveGer.gf @@ -3,29 +3,28 @@ concrete AdjectiveGer of Adjective = CatGer ** open ResGer, Prelude in { flags optimize=all_subs ; lin - PositA a = { s = a.s ! Posit ; + s2 = \\_ => [] ; isPre = True ; c = <[],[]> ; ext = [] } ; - ComparA a np = - let nps = np.s ! False ! Nom ++ bigNP np - in { - s = \\af => a.s ! Compar ! af ++ conjThan ++ nps ; + ComparA a np = { + s = \\af => a.s ! Compar ! af ; + s2 = \\c => conjThan ++ np.s ! False ! c ++ np.ext ++ np.rc ; isPre = True ; c = <[],[]> ; ext = [] } ; - CAdvAP ad ap np = - let nps = np.s ! False ! Nom ++ bigNP np in - ap ** { - s = \\af => ad.s ++ ap.s ! af ++ ad.p ++ nps ; - isPre = False + CAdvAP adv ap np = ap ** { + s = \\af => adv.s ++ ap.s ! af ; + s2 = \\c => adv.p ++ np.s ! False ! c ++ np.ext ++ np.rc ; + isPre = True -- HL 1/2023 } ; UseComparA a = { s = \\af => a.s ! Compar ! af ; + s2 = \\_ => [] ; isPre = True ; c = <[],[]> ; ext = [] @@ -33,6 +32,7 @@ concrete AdjectiveGer of Adjective = CatGer ** open ResGer, Prelude in { AdjOrd a = { s = a.s ; + s2 = \\_ => [] ; isPre = True ; c = <[],[]> ; ext = [] @@ -41,25 +41,24 @@ concrete AdjectiveGer of Adjective = CatGer ** open ResGer, Prelude in { -- $SuperlA$ belongs to determiner syntax in $Noun$. ComplA2 a np = - let CExt = case a.c2.isPrep of { - isCase => ; - _ => <[], appPrepNP a.c2 np> } + let + obj = appPrepNP a.c2 np in { - s = a.s ! Posit ; - isPre = True ; - c = CExt ; - ext = [] + s = a.s ! Posit ; + s2 = \\_ => [] ; + isPre = True ; + c = case a.c2.t of {isCase => ; _ => <[], obj>} ; + ext = [] } ; ReflA2 a = let - compl = appPrep a.c2 (reflPron ! agrP3 Sg) ; - CExt = case a.c2.isPrep of - {isCase => ; _ => <[], compl> } + obj = appPrep a.c2 (reflPron ! agrP3 Sg) ; in { s = a.s ! Posit ; + s2 = \\_ => [] ; isPre = True ; - c = CExt ; + c = case a.c2.t of {isCase => ; _ => <[], obj>} ; ext = [] } ; @@ -72,9 +71,12 @@ concrete AdjectiveGer of Adjective = CatGer ** open ResGer, Prelude in { UseA2 a = { s = a.s ! Posit ; + s2 = \\_ => [] ; isPre = True ; c = <[],[]> ; ext = [] } ; + AdvAP ap adv = ap ** {s = \\a => adv.s ++ ap.s ! a} ; -- HL 1/2024 + } diff --git a/src/german/AllGer.gf b/src/german/AllGer.gf index 83e6751f5..471083a5d 100644 --- a/src/german/AllGer.gf +++ b/src/german/AllGer.gf @@ -3,7 +3,6 @@ concrete AllGer of AllGerAbs = LangGer, IrregGer, ----- ExtendGer, ---- to replace ExtraGer - ExtraGer - ** open ExtendGer in {} ---- to force compilation + ExtendGer + ** open ExtraGer in {} ---- to force compilation ; diff --git a/src/german/AllGerAbs.gf b/src/german/AllGerAbs.gf index de0836698..9293d25cb 100644 --- a/src/german/AllGerAbs.gf +++ b/src/german/AllGerAbs.gf @@ -1,8 +1,7 @@ ---# -path=.:../abstract:../common:prelude +--# -path=.:../abstract:../common:../prelude abstract AllGerAbs = Lang, IrregGerAbs, ----- Extend, - ExtraGerAbs + Extend ** {} ; diff --git a/src/german/CatGer.gf b/src/german/CatGer.gf index 1f4c64b9e..be5a5b3a9 100644 --- a/src/german/CatGer.gf +++ b/src/german/CatGer.gf @@ -29,7 +29,7 @@ concrete CatGer of Cat = IP = {s : Case => Str ; n : Number} ; IComp = {s : Agr => Str ; ext : Str} ; IDet = {s : Gender => Case => Str ; n : Number} ; - IQuant = {s : Number => Gender => Case => Str} ; + IQuant = {s : GenNum => Case => Str} ; -- Relative @@ -44,10 +44,13 @@ concrete CatGer of Cat = -- Adjective (HL 7/23: we need c : Agr => Str * Str to handle reflexive objects, cf ReflA2) - AP = {s : AForm => Str ; isPre : Bool ; c: Str * Str ; ext : Str} ; - -- ich bin [c1 ihm] treu - -- du bist so klug gewesen [ext ihn zu lesen] - -- ich bin stolz [c2 auf dich] + AP = { + s : AForm => Str ; -- (strong) adjective paradigm + s2 : Case => Str ; -- comparison np, e.g. [s kleineres] (Tier) [s2 als den Hund] HL 1/34 + isPre : Bool ; -- pre-nominal as attribute, e.g. False with sentential complement + c: Str * Str ; -- np,pp-complement, e.g. (ich bin) [c1 ihm] treu ; stolz [c2 auf dich] + ext : Str -- s,inf-complement, (du bist) so klug (gewesen) [ext ihn zu lesen] + } ; -- Noun @@ -59,17 +62,17 @@ concrete CatGer of Cat = g : Gender } ; NP = ResGer.NP ; - Pron = {s : NPForm => Str ; a : Agr} ; + Pron = {s : NPForm => Str ; a : Agr ; sp : PossForm => Str} ; 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 ; - a : Adjf ; - aPl : Adjf ; --- to distinguish "meine guten Freunde" / "gute Freunde" - hasDefArt : Bool + s : Bool => GenNum => Case => Str ; -- True if leading DefArtSg is dropped + sp : GenNum => Case => Str ; -- and contracted with preposition + a : Adjf ; + isDefArt : Bool ; + delCardOne : Bool -- delete following cardinal 1 (IndefArt and no_Quant) } ; Predet = { s : Number => Gender => Case => Str ; @@ -77,8 +80,8 @@ concrete CatGer of Cat = a : PredetAgr -- if an agr is forced, e.g. jeder von uns ist ... } ; - Num = {s : Gender => Case => Str ; n : Number ; isNum : Bool} ; - Card = {s : Gender => Case => Str ; n : Number} ; + Num = {s,sp : AForm => Str ; n : Number ; isNum : Bool} ; -- Num,Card.s AForm HL 12/23 + Card = {s : AForm => Str ; n : Number} ; -- inflection mainly for: einer,eine,eines Ord = {s : AForm => Str} ; -- Numeral @@ -95,18 +98,19 @@ concrete CatGer of Cat = -- Open lexical classes, e.g. Lexicon - V, VA, VS, VQ = ResGer.Verb ; -- = {s : VForm => Str} ; + V, VA, VS, VQ = Verb ; -- = {s : VForm => Str} ; VV = Verb ** {isAux : Bool} ; V2, V2A, V2S, V2Q = Verb ** {c2 : Preposition} ; V2V = Verb ** {c2 : Preposition ; isAux : Bool ; objCtrl : Bool} ; V3 = Verb ** {c2, c3 : Preposition} ; - A = {s : Degree => AForm => Str} ; - A2 = {s : Degree => AForm => Str ; c2 : Preposition} ; + A = Adjective ; -- = {s : Degree => AForm => Str} ; + A2 = Adjective ** {c2 : Preposition} ; - N = ResGer.Noun ; - N2 = ResGer.Noun ** {c2 : Preposition} ; - N3 = ResGer.Noun ** {c2,c3 : Preposition} ; + N = Noun ; -- {s : Number => Case => Str ; co : Str ; + -- uncap : {s: Number => Case => Str ; co : Str} ; g : Gender} + N2 = Noun ** {c2 : Preposition} ; + N3 = Noun ** {c2,c3 : Preposition} ; GN = {s : Case => Str; g : Sex} ; SN = {s : Sex => Case => Str} ; PN = {s : Case => Str; g : Gender; n : Number} ; @@ -119,7 +123,7 @@ concrete CatGer of Cat = linref NP = \np -> np.s ! False ! Nom ++ np.ext ++ np.rc ; -- HL 7/2022 Bool added - CN = \cn -> cn.s ! Strong ! Pl ! Nom ++ cn.adv ++ cn.ext ++ cn.rc ! Pl ; + CN = \cn -> cn.s ! Strong ! Sg ! Nom ++ cn.adv ++ cn.ext ++ cn.rc ! Sg ; SSlash = \ss -> ss.s ! Main ++ ss.c2.s ! GPl ; ClSlash = \cls -> cls.s ! MIndic ! Pres ! Simul ! Pos ! Main ++ cls.c2.s ! GPl ; @@ -127,7 +131,7 @@ concrete CatGer of Cat = VP = \vp -> useInfVP False vp ; VPSlash = \vps -> useInfVP False vps ++ vps.c2.s ! GPl ++ vps.ext; - AP = \ap -> ap.c.p1 ++ ap.s ! APred ++ ap.c.p2 ++ ap.ext ; + AP = \ap -> ap.c.p1 ++ ap.s ! APred ++ ap.c.p2 ++ ap.s2 ! Nom ++ ap.ext ; A2 = \a2 -> a2.s ! Posit ! APred ++ a2.c2.s ! GPl ; V, VS, VQ, VA = \v -> useInfVP False (predV v) ; @@ -140,7 +144,7 @@ concrete CatGer of Cat = Conj = \c -> c.s1 ++ c.s2 ; Det = \det -> det.s ! False ! Masc ! Nom ; - Prep = \prep -> case prep.isPrep of {isPrepDefArt => prep.s ! GSg Masc ; - _ => prep.s ! GPl } ; + Prep = \prep -> case prep.t of {isPrepDefArt => prep.s ! GSg Masc ; + _ => prep.s ! GPl } ; } diff --git a/src/german/ConjunctionGer.gf b/src/german/ConjunctionGer.gf index 790461bd5..a8bc7b097 100644 --- a/src/german/ConjunctionGer.gf +++ b/src/german/ConjunctionGer.gf @@ -20,6 +20,7 @@ concrete ConjunctionGer of Conjunction = in (conjAgr agr ss.a) }) ; ConjAP conj ss = conjunctDistrTable AForm conj ss ** { + s2 = \\c => [] ; -- comparison np of ap = {s:AForm => Str; s2:Case => Str} HL 1/23 isPre = ss.isPre ; c = ss.c ; ext = ss.ext} ; ConjRS conj ss = conjunctDistrTable RelGenNum conj ss ** { @@ -87,8 +88,8 @@ concrete ConjunctionGer of Conjunction = [CN] = {s1,s2 : Adjf => Number => Case => Str ; g : Gender} ; oper - bigAP : AP -> AForm => Str = \ap -> - \\a => ap.c.p1 ++ ap.s ! a ++ ap.c.p2 ++ ap.ext; + bigAP : AP -> AForm => Str = \ap -> -- HL 1/23: not always ok: + \\a => ap.c.p1 ++ ap.s ! a ++ ap.c.p2 ++ ap.ext ++ ap.s2 ! Nom ; -- comparison np in Nom bigCN : CN -> Adjf => Number => Case => Str = \cn -> \\a,n,c => cn.s ! a ! n ! c ++ cn.adv ++ cn.ext ++ cn.rc ! n ; diff --git a/src/german/ConstructionGer.gf b/src/german/ConstructionGer.gf index 7f43a4a25..be80e6815 100644 --- a/src/german/ConstructionGer.gf +++ b/src/german/ConstructionGer.gf @@ -2,7 +2,7 @@ concrete ConstructionGer of Construction = CatGer ** open SyntaxGer, SymbolicGer, (P = ParadigmsGer), - (L = LexiconGer), (E = ExtraGer), (G = GrammarGer), (I = IrregGer), (R = ResGer), (N = NounGer), Prelude in { + (L = LexiconGer), (E = ExtendGer), (G = GrammarGer), (I = IrregGer), (R = ResGer), (N = NounGer), Prelude in { flags coding=utf8 ; oper @@ -89,7 +89,7 @@ lin in SyntaxGer.mkAdv (for_Prep | accPrep) n_hours_NP ; timeunitRange l u time = - {s = l.s ! R.Masc ! R.Nom ++ "bis" ++ u.s ! R.Masc ! R.Nom ++ time.s ! R.Pl ! R.Nom} ; + {s = l.s ! R.AMod (R.gennum R.Masc l.n) R.Nom ++ "bis" ++ u.s ! R.AMod (R.gennum R.Masc u.n) R.Nom ++ time.s ! R.Pl ! R.Nom} ; oper mkHour : Str -> Str -> Str -> Hour diff --git a/src/german/ExtendGer.gf b/src/german/ExtendGer.gf index ddfa488db..ac2246799 100644 --- a/src/german/ExtendGer.gf +++ b/src/german/ExtendGer.gf @@ -2,15 +2,19 @@ concrete ExtendGer of Extend = CatGer ** ExtendFunctor - - [ - InOrderToVP, - VPS, ListVPS, VPI, ListVPI, RNP, RNPList, - MkVPS, BaseVPS, ConsVPS, ConjVPS, PredVPS, - MkVPI, BaseVPI, ConsVPI, ConjVPI, ComplVPIVV, - ComplSlashPartLast, - Base_nr_RNP, Base_rn_RNP, Base_rr_RNP, Conj_RNP, - CardCNCard, CompoundN, - PassVPSlash, PassAgentVPSlash, PastPartAP, PastPartAgentAP + - [ -- remove the default implementations of: + GenNP, EmptyRelSlash, + VPS, ListVPS, MkVPS, BaseVPS, ConsVPS, ConjVPS, PredVPS, + VPI, ListVPI, MkVPI, BaseVPI, ConsVPI, ConjVPI, ComplVPIVV, + ICompAP, IAdvAdv, CompIQuant, PrepCN, + PastPartAP, PastPartAgentAP, + PassVPSlash, PassAgentVPSlash, + AdvIsNP, + RNP, RNPList, Base_rr_RNP, Base_nr_RNP, Base_rn_RNP, Cons_rr_RNP, Cons_nr_RNP, Conj_RNP, + ReflRNP, ReflPron, ReflPoss, PredetRNP, AdvRNP, ReflA2RNP, PossPronRNP, + CompoundN, DetNPMasc, DetNPFem, UseDAP, UseDAPMasc, UseDAPFem, + CardCNCard, + InOrderToVP ] with (Grammar = GrammarGer) ** @@ -19,7 +23,25 @@ concrete ExtendGer of Extend = ResGer, Coordination, Prelude, - ParadigmsGer in { + (P = ParadigmsGer) in { + + lin + GenNP np = + let tab : GenNum => Case => Str = + \\gn,c => np.s ! False ! Gen ++ np.ext ++ np.rc + in {s = \\_ => tab ; + sp = tab ; + a = Strong ; + isDefArt = False ; + delCardOne = False + } ; + + EmptyRelSlash slash = { + s = \\m,t,a,p,gn => + appPrep slash.c2 (relPron ! gn) ++ slash.s ! m ! t ! a ! p ! Sub ; + c = slash.c2.c + } ; + lincat VPI = {s : Bool => Str} ; @@ -27,37 +49,13 @@ concrete ExtendGer of Extend = VPS = {s : Order => Agr => Str} ; [VPS] = {s1,s2 : Order => Agr => Str} ; -lin - - InOrderToVP vp = {s = "um" ++ useInfVP False vp} ; - + lin BaseVPI = twoTable Bool ; ConsVPI = consrTable Bool comma ; - MkVPI vp = {s = \\b => useInfVP b vp} ; - ConjVPI = conjunctDistrTable Bool ; - - ComplVPIVV v vpi = - insertInf {inpl = <\\_ => [], (vpi.s ! v.isAux)> ; extr = \\_ => []} -- HL 3/22 - (predVGen v.isAux v) ; - BaseVPS = twoTable2 Order Agr ; ConsVPS = consrTable2 Order Agr comma ; - PredVPS np vpi = - let - subj = np.s ! False ! Nom ++ bigNP np ; - agr = np.a ; - in { - s = \\o => - let verb = vpi.s ! o ! agr - in case o of { - Main => subj ++ verb ; - Inv => verb ++ subj ; ---- älskar henne och sover jag - Sub => subj ++ verb - } - } ; - MkVPS tm p vp = let vps = useVP vp in { s = \\o,agr => @@ -115,7 +113,254 @@ lin } ; ConjVPS = conjunctDistrTable2 Order Agr ; + + PredVPS np vpi = + let + subj = np.s ! False ! Nom ++ bigNP np ; + agr = np.a ; + in { + s = \\o => + let verb = vpi.s ! o ! agr + in case o of { + Main => subj ++ verb ; + Inv => verb ++ subj ; ---- älskar henne och sover jag + Sub => subj ++ verb + } + } ; + +-- existentials that work in the absence of Cl + MkVPI vp = {s = \\b => useInfVP b vp} ; + + ConjVPI = conjunctDistrTable Bool ; + + ComplVPIVV v vpi = + insertInf {inpl = <\\_ => [], (vpi.s ! v.isAux)> ; extr = \\_ => []} -- HL 3/22 + (predVGen v.isAux v) ; + +-- the same for VPSlash, taking a complement with shared V2 verbs + +-- Conjunction of copula complements + +-- Conjunction of imperatives + + ICompAP ap = { + s = \\_ => "wie" ++ ap.s ! APred ; + ext = ap.c.p1 ++ ap.c.p2 ++ ap.ext + } ; + + IAdvAdv adv = {s = "wie" ++ adv.s} ; + + CompIQuant iq = { + s = \\a => iq.s ! (gennum (genderAgr a) (numberAgr a))! Nom ; + ext = "" + } ; + + PrepCN prep cn = { + s = prep.s ! GPl ++ cn.s ! Strong ! Sg ! prep.c ++ cn.adv ++ cn.rc ! Sg ++ cn.ext} ; + + -- fronted/focal constructions, only for main clauses + + -- participle constructions + + PastPartAP vp = + let a = agrP3 Sg in { + 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 ; + s2 = \\_ => [] ; + isPre = True ; + c = <[],[]> ; + ext = vp.ext + } ; + + PastPartAgentAP vp np = + let a = agrP3 Sg ; + 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.adj ++ vp.inf.inpl.p2 + ++ vp.c2.s ! GPl -- junk if not TV + ++ vp.ext ++ (vp.inf.extr ! a) ++ vp.s.s ! VPastPart af ; + s2 = \\_ => [] ; + isPre = True ; + c = <[],[]> ; + ext = [] + } ; + +-- this is a generalization of Verb.PassV2 and should replace it in the future. + + PassVPSlash vp = + 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 + + PassAgentVPSlash vp np = ---- "von" here, "durch" in StructuralGer + insertObj (\\_ => (PastPartAgentAP (lin VPSlash vp) (lin NP np)).s ! APred) (predV werdenPass) ; + +-- publishing of the document + +-- counterpart to ProgrVP, for VPSlash + +-- construct VPSlash from A2 and N2 + +-- existential for mathematics + +-- existentials with a/no variation + +-- generalisation of existential, with adverb as an argument + + AdvIsNP adv np = let comp : Agr => Str = \\agr => np.s ! False ! Nom ++ np.rc ++ np.ext in + mkClause adv.s np.a (insertObj comp (predV sein_V)) ; -- HL 12/2023, prelim, wrong order + +-- infinitive for purpose AR 21/8/2013 + +-- object S without "that" + +-- front the extraposed part + +-- proper structure of "it is AP to VP" + +-- to use an AP as CN or NP without CN + +-- infinitive complement for IAdv + +-- alternative to EmbedQS. For English, EmbedQS happens to work, + +-- Reflexive noun phrases -- (HL 5/2022: improved and completed, RNPList added) + + lincat + RNP = {s : Agr => Case => Str ; rc,ext : Str ; isPron : Bool} ; + RNPList = {s1,s2 : Agr => Case => Str} ; + + linref + RNP = \rnp -> rnp.s ! AgSgP3 Masc ! Acc ++ rnp.ext ++ rnp.rc ; + + lin + ReflRNP vps rnp = + insertObjReflNP (lin RNP rnp) vps ; + + ReflPron = { -- with personal pronoun nominative + s = ResGer.reflPron ; rc,ext = [] ; isPron = True } ; + + -- 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 + -- we might define ReflPron by the stronger + -- oper + -- reflPronSelf : Agr => Case => Str = + -- \\a => \\c => reflPron ! a ! c ++ "selbst" ; + + lin + 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 ! AMod (gennum cn.g num.n) 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} ; + + -- 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 + -- we might define ReflPoss by the stronger + -- oper + -- 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)) ; + + 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 => k} ; + 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 ! 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 = 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 ; + s2 = \\_ => [] ; + isPre = True ; + c = case adj.c2.t of {isCase => ; _ => <[], 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 = \\_,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 ! 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 ; + +-- reflexive possessive on its own right, like in Swedish, Czech, Slovak + +--- from Extensions + + CompoundN a x = + let s = a.co in lin N { + s = \\n,c => s ++ Predef.BIND ++ x.uncap.s ! n ! c ; + co = s ++ Predef.BIND ++ x.uncap.co ; + uncap = { + s = \\n,c => a.uncap.co ++ Predef.BIND ++ x.uncap.s ! n ! c ; + co = a.uncap.co ++ Predef.BIND ++ x.uncap.co ; + } ; + g = x.g + } ; + +-- very language-specific things + +-- Romance + + DetNPMasc det = { + s = \\b,c => det.sp ! b ! Masc ! c ; + a = agrgP3 Masc det.n ; + 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} ;--WLight ; + ext, rc = [] + } ; + +-- German + +-- UseDAP replaces DetNP from the RGL which is more limited. + UseDAP det = { s = \\b,c => det.sp ! Neutr ! c ; a = agrP3 det.n ; @@ -137,168 +382,32 @@ lin rc, ext = [] } ; -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) ** - { c1 = subjPrep vp.c2 } ; - -- this also gives "mit dir wird gerechnet" ; - -- the alternative linearisation ("es wird mit dir gerechnet") is not implemented - -lin PassAgentVPSlash vp np = ---- "von" here, "durch" in StructuralGer - insertObj (\\_ => (PastPartAgentAP (lin VPSlash vp) (lin NP np)).s ! APred) (predV werdenPass) ; - -lin PastPartAP vp = - let a = agrP3 Sg in { - 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 = <[],[]> ; - ext = vp.ext + CardCNCard card cn = { + s = let det = (Grammar.DetQuant Grammar.IndefArt (Grammar.NumCard card)) ; + np = (Grammar.DetCN det cn).s ! False + in table{APred => np ! Nom ; AMod gn c => np ! c} ; -- HL 12/2023 + n = Pl } ; -lin PastPartAgentAP vp np = - let a = agrP3 Sg ; - agent = appPrepNP von_Prep 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.ext ++ (vp.inf.extr ! a) ++ vp.s.s ! VPastPart af ; - isPre = True ; - c = <[],[]> ; - ext = [] - } ; -lin CompoundN a x = - let s = a.co in - lin N { - s = \\n,c => s ++ Predef.BIND ++ x.uncap.s ! n ! c ; - co = s ++ Predef.BIND ++ x.uncap.co ; - uncap = { - s = \\n,c => a.uncap.co ++ Predef.BIND ++ x.uncap.s ! n ! c ; - co = a.uncap.co ++ Predef.BIND ++ x.uncap.co ; - } ; - g = x.g - } ; + InOrderToVP vp = {s = "um" ++ useInfVP False vp} ; - --- 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 + let + obj : Agr => Str = \\a => prep.s ! GPl ++ rnp.s ! a ! prep.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 + 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 7772ea5ba..e7586f5ed 100644 --- a/src/german/ExtraGer.gf +++ b/src/german/ExtraGer.gf @@ -29,7 +29,7 @@ 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 {a => iq.s ! numberAgr a ! genderAgr a ! Nom} ; ext = ""} ; + CompIQuant iq = {s = table {a => iq.s ! (gennum (genderAgr a) (numberAgr a))! Nom} ; ext = ""} ; IAdvAdv adv = {s = "wie" ++ adv.s} ; @@ -71,6 +71,7 @@ concrete ExtraGer of ExtraGerAbs = CatGer ** let a = agrP3 Sg in { 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 ; + s2 = \\_ => [] ; isPre = True ; c = <[],[]> ; ext = vp.ext @@ -84,6 +85,7 @@ concrete ExtraGer of ExtraGerAbs = CatGer ** ++ vp.a2 ++ agent ++ vp.adj ++ vp.inf.inpl.p2 ++ vp.c2.s ! GPl -- junk if not TV ++ vp.ext ++ (vp.inf.extr ! a) ++ vp.s.s ! VPastPart af ; + s2 = \\_ => [] ; isPre = True ; c = <[],[]> ; ext = [] @@ -194,7 +196,7 @@ concrete ExtraGer of ExtraGerAbs = CatGer ** 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, + in possPron a num.n cn.g c ++ num.s ! AMod (gennum cn.g num.n) 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 ; @@ -230,8 +232,9 @@ concrete ExtraGer of ExtraGerAbs = CatGer ** compl = appPrep adj.c2 (rnp.s ! agrP3 Sg) ; -- we use a fixed agreement in { s = adj.s ! Posit ; + s2 = \\_ => [] ; isPre = True ; - c = case adj.c2.isPrep of {isCase => ; _ => <[], compl>} ; + c = case adj.c2.t of {isCase => ; _ => <[], compl>} ; ext = rnp.ext ++ rnp.rc } ; @@ -269,32 +272,18 @@ concrete ExtraGer of ExtraGerAbs = CatGer ** 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 + let + obj : Agr => Str = \\a => prep.s ! GPl ++ rnp.s ! a ! prep.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 + case of { -- consider non-pron rnp as light, add to vpnn.p2 => ; -- pronoun switch: => ; -- accPron < pron => ; -- < 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 diff --git a/src/german/ExtraGerAbs.gf b/src/german/ExtraGerAbs.gf index e63d01154..f52e93cbd 100644 --- a/src/german/ExtraGerAbs.gf +++ b/src/german/ExtraGerAbs.gf @@ -3,6 +3,7 @@ abstract ExtraGerAbs = Extra [ VPS,ListVPS,BaseVPS,ConsVPS,ConjVPS,MkVPS,PredVPS,EmptyRelSlash, VPSlash, PassVPSlash, PassAgentVPSlash, CompIQuant, PastPartAP, PastPartAgentAP, Temp,Tense,Pol,S,NP,VV,VP,Conj,IAdv,IQuant,IComp,ICompAP,IAdvAdv,Adv,AP, + Cl, Num, CN, Utt, Predet, Foc,FocObj,FocAdv,FocAP,UseFoc, RNP,ReflRNP,ReflPron,ReflPoss,PredetRNP ,RNPList,ConjRNP,Base_rr_RNP,Base_nr_RNP,Base_rn_RNP,Cons_rr_RNP,Cons_nr_RNP diff --git a/src/german/MakeStructuralGer.gf b/src/german/MakeStructuralGer.gf index be9dab510..50d7c5d5d 100644 --- a/src/german/MakeStructuralGer.gf +++ b/src/german/MakeStructuralGer.gf @@ -8,7 +8,7 @@ oper mkSubj : Str -> Subj = \x -> {s = x ; lock_Subj = <>} ; mkIQuant : Str -> IQuant = \s -> - {s = \\_,_,_ => s ; lock_IQuant = <>} ; + {s = \\_,_ => s ; lock_IQuant = <>} ; mkPredet = overload { mkPredet : A -> Predet = \a -> @@ -27,11 +27,13 @@ oper -- e.g. das selbe mmkQuant : Quant -> A -> Quant = \q,a -> q ** { - s,sp = \\b,x,n,g,c => q.s ! b ! x ! n ! g ! c ++ a.s ! Posit ! agrAdj g q.a n c + s = \\b,gn,c => q.s ! b ! gn ! c ++ a.s ! Posit ! agrAdj q.a gn c ; + sp = \\gn,c => q.s ! False ! gn ! c ++ a.s ! Posit ! agrAdj q.a gn c } ; -- e.g. derjenige mmbQuant : Quant -> A -> Quant = \q,a -> q ** { - s,sp = \\b,x,n,g,c => q.s ! b ! x ! n ! g ! c + a.s ! Posit ! agrAdj g q.a n c + s = \\b,gn,c => q.s ! b ! gn ! c + a.s ! Posit ! agrAdj q.a gn c ; + sp = \\gn,c => q.s ! False ! gn ! c + a.s ! Posit ! agrAdj q.a gn c } ; } diff --git a/src/german/MorphoGer.gf b/src/german/MorphoGer.gf index dc46adc7a..4b4fa6673 100644 --- a/src/german/MorphoGer.gf +++ b/src/german/MorphoGer.gf @@ -1,4 +1,4 @@ ---# -path=.:../common:../../prelude +--# -path=.:../common:../prelude: -- ----1 A Simple German Resource Morphology ---- @@ -18,7 +18,7 @@ oper -- For $StructuralGer$. mkPrep : Str -> Case -> Preposition = \s,c -> - {s = \\_ => s ; s2 = [] ; c = c ; isPrep = isPrep} ; + {s = \\_ => s ; s2 = [] ; c = c ; t = isPrep} ; nameNounPhrase : Gender -> {s : Case => Str} -> {s : Bool => Case => Str ; a : Agr ; @@ -83,7 +83,7 @@ oper cardOrd : Str -> Str -> CardOrd => Str = \drei,dritte -> table { - NCard _ _ => drei ; + NCard _ => drei ; NOrd a => (regA (init dritte)).s ! Posit ! a } ; @@ -102,7 +102,7 @@ oper regDigit : Str -> LinDigit = \vier -> mkDigit vier (vier + "zehn") (vier + "zig") (vier + "te") ; - invNum : CardOrd = NCard Masc Nom ; + invNum : CardOrd = NCard (AMod (GSg Masc) Nom) ; } ; diff --git a/src/german/NamesGer.gf b/src/german/NamesGer.gf index 5f6f8391c..43c17cda9 100644 --- a/src/german/NamesGer.gf +++ b/src/german/NamesGer.gf @@ -79,7 +79,7 @@ lin InLN ln = { lin AdjLN ap ln = ln ** { s = \\a,c => preOrPost ap.isPre - (ap.c.p1 ++ ap.c.p2 ++ ap.s ! agrAdj ln.g a ln.n c ++ ap.ext) + (ap.c.p1 ++ ap.c.p2 ++ ap.s ! agrAdj a (gennum ln.g ln.n) c ++ ap.ext) (ln.s ! a ! c) ; } ; diff --git a/src/german/NounGer.gf b/src/german/NounGer.gf index 558ab8a14..a15ad2230 100644 --- a/src/german/NounGer.gf +++ b/src/german/NounGer.gf @@ -9,7 +9,7 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in { lin DetCN det cn = { - s = \\b,c => det.s ! b ! cn.g ! c ++ cn.s ! (adjfCase det.a c) ! det.n ! c ++ cn.adv ; + s = \\b,c => det.s ! b ! cn.g ! c ++ cn.s ! det.a ! det.n ! c ++ cn.adv ; a = agrgP3 cn.g det.n ; -- isLight = det.isDef ; -- ich sehe den Mann nicht vs. ich sehe nicht einen Mann -- HL 6/2019 (but:) sehe (die|einige) Männer nicht; don't see a|no man = sehe keinen Mann @@ -20,11 +20,13 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in { ext = cn.ext } ; - DetNP det = { -- more genders in ExtraGer -- HL: der+er,den+en ; der drei,den drei+en + DetNP det = { -- more genders in ExtendGer s = \\b,c => det.sp ! b ! Neutr ! c ; a = agrP3 det.n ; -- isPron = False ; -- HL 6/2019: don't apply pronoun switch: ich gebe ihr das vs. ich gebe es ihr - w = case det.isDef of { True => WLight ; _ => WHeavy } ; + w = case det.isDef of { True => case det.hasDefArt of { True => WDefArt ; + _ => WLight } ; + _ => WHeavy } ; rc, ext = [] } ; @@ -68,93 +70,116 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in { w = WHeavy } ; + oper + einziger : AForm => Str = table{AMod gn c => "einzig" + adjEnding ! gn ! c ; _ => "einziges"} ; + + lin DetQuantOrd quant num ord = let n = num.n ; - a = quant.a + a = quant.a ; + d = quant.isDefArt ; + isCardOne = case n of {Sg => num.isNum ; _ => False} ; + nums : AForm => Str = \\af => case af of { + AMod (GSg g) c => case of { + => einziger ! af ; -- (ein,kein) einziger + <_,True> => num.sp ! af ; -- (der,dieser) eine ; (mein) einer + _ => num.s ! af } ; -- (die,diese) zwei ---- todo inflection + _ => num.s ! APred} 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,sp = \\b,g,c => let gn = gennum g n in + quant.s ! b ! gn ! c ++ nums ! agrAdj a gn c ++ ord.s ! agrAdj a gn c ; n = n ; - a = case n of {Sg => a ; Pl => quant.aPl} ; - isDef = case of { => False ; _ => True} ; - hasDefArt = quant.hasDefArt ; + a = a ; + isDef = case a of {Strong => False ; _ => True} ; + hasDefArt = d } ; DetQuant quant num = let n = num.n ; a = quant.a ; - b = andB quant.hasDefArt (case num.n of {Sg => True ; _ => False}) + d = quant.isDefArt ; + isCardOne = case n of {Sg => num.isNum ; _ => False} ; + quantsp : Bool => GenNum => Case => Str = + case num.isNum of {True => quant.s ; False => \\b => quant.sp} ; + nums : AForm => Str = \\af => case af of { + AMod (GSg g) c => case of { + => einziger ! af ; -- (k)ein einziger, drop cardinal "ein" of num + <_,True> => num.sp ! af ; -- (der,dieser) eine ; (mein) einer + _ => num.s ! af } ; + AMod GPl c => num.s ! APred ; -- (den,diesen) zwei(en) ---- todo: inflection + APred => num.s ! APred} 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 ; - -- HL: der+er,den+en ; der drei,den drei+en + s = \\b,g,c => let gn = gennum g n in + quant.s ! b ! gn ! c ++ nums ! agrAdj a gn c ; + sp = \\b,g,c => let gn = gennum g n in + quantsp ! b ! gn ! c ++ nums ! agrAdj a gn c ; n = n ; - a = case n of {Sg => a ; Pl => quant.aPl} ; - isDef = case of { => False ; _ => True} ; - 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 ; - a = Strong ; - aPl = Weak ; - hasDefArt = False ; + a = a ; + isDef = case a of {Strong => False ; _ => True} ; + hasDefArt = d } ; - NumCard n = n ** {isNum = True} ; + PossPron p = { + s = \\_,gn,c => p.s ! NPPoss gn c ; -- mein (dritter) + sp = \\gn,c => p.sp ! PossF gn c ; -- meiner + a = Mixed ; + isDefArt = False ; + delCardOne = False ; + } ; - NumPl = {s = \\g,c => []; n = Pl ; isNum = False} ; - NumSg = {s = \\g,c => []; n = Sg ; isNum = False} ; + NumCard n = n ** { + isNum = True ; + sp = table {AMod gn c => n.s ! APred ++ BIND ++ adjEnding ! gn ! c ; + APred => n.s ! APred} + } ; - NumDigits numeral = {s = \\g,c => numeral.s ! NCard g c; n = numeral.n } ; - OrdDigits numeral = {s = \\af => numeral.s ! NOrd af} ; + NumPl = {s,sp = \\_ => []; n = Pl ; isNum = False} ; + NumSg = {s,sp = \\_ => []; n = Sg ; isNum = False} ; + + NumDigits digits = {s = \\af => digits.s ! NCard af ; n = digits.n} ; + OrdDigits digits = {s = table{APred => "am" ++ digits.s ! NOrd APred ++ BIND ++ "en" ; + af => digits.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 } ; + NumDecimal decimal = {s = \\af => decimal.s ! NCard af ; n = decimal.n } ; - NumNumeral numeral = {s = \\g,c => numeral.s ! NCard g c; n = numeral.n } ; - OrdNumeral numeral = {s = \\af => numeral.s ! NOrd af} ; + NumNumeral numeral = {s = \\af => numeral.s ! NCard af ; n = numeral.n } ; + OrdNumeral numeral = {s = table{APred => "am" ++ numeral.s ! NOrd APred ++ BIND ++ "en" ; + af => numeral.s ! NOrd af}} ; - AdNum adn num = {s = \\g,c => adn.s ++ num.s!g!c; n = num.n } ; + AdNum adn num = {s = \\af => adn.s ++ num.s ! af ; n = num.n } ; - OrdSuperl a = {s = a.s ! Superl} ; - - OrdNumeralSuperl n a = {s = \\af => n.s ! NOrd APred ++ Predef.BIND ++ a.s ! Superl ! af} ; -- drittbeste + OrdSuperl a = {s = table {APred => "am" ++ a.s ! Superl ! APred ; + af => a.s ! Superl ! af}} ; + OrdNumeralSuperl n a = + {s = table {APred => "am" ++ n.s ! NOrd APred ++ BIND ++ a.s ! Superl ! APred ; -- am drittbesten + af => n.s ! NOrd APred ++ BIND ++ a.s ! Superl ! af} -- drittbeste + } ; DefArt = { - 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 } ; -- von den+en - a, aPl = Weak ; - hasDefArt = True + s = \\b,gn,c => case of { => [] ; _ => artDef ! gn ! c} ; + sp = \\gn,c => case of { + => "dessen" ; + => "derer" ; + => "dessen" ; + => "denen" ; -- HL 6/2019 + => "derer" ; -- HL 6/2019 + _ => artDef ! gn ! c } ; + a = Weak ; + isDefArt = True ; + delCardOne = False ; } ; IndefArt = { - s = \\_ => table { - True => \\_,_,c => [] ; - False => table { - Sg => \\g,c => "ein" + pronEnding ! GSg g ! c ; - Pl => \\_,c => [] - } - } ; - sp = \\_ => table { - True => \\_,_,c => [] ; - False => table { - Sg => \\g,c => (detUnlikeAdj False Sg "ein").s ! g ! c ; - Pl => \\_,c => caselist "einige" "einige" "einigen" "einiger" ! c - } - } ; - a, aPl = Strong ; - hasDefArt = False + s = \\_ => table {GSg g => \\c => "ein" + pronEnding ! (GSg g) ! c ; + GPl => \\c => []} ; + sp = table {GSg g => \\c => "ein" + detEnding ! (GSg g) ! c ; + GPl => caselist "einige" "einige" "einigen" "einiger"} ; + a = MixedStrong ; -- Sg Mixed, Pl Strong + isDefArt = False ; + delCardOne = True ; } ; MassNP cn = { @@ -201,10 +226,12 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in { let g = cn.g in cn ** { - 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) ; + s = case ap.isPre of { -- HL 1/2023 False only for ap = SentAP ap' sc + True => \\a,n,c => -- besserer cn als a.s2 [instead: cn, besser als a.s2,] + (ap.c.p1 ++ ap.c.p2 ++ ap.s ! agrAdj a (gennum g n) c) + ++ (cn.s ! a ! n ! c) ++ ap.s2 ! c ++ ap.ext ; + False => \\a,n,c => cn.s ! a ! n ! c ++ -- postnominal ap with sc + embedInCommas (ap.c.p1 ++ ap.c.p2 ++ ap.s ! APred ++ ap.s2 ! c ++ ap.ext)} ; g = g } ; @@ -236,7 +263,7 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in { -- det or numeral? np or rather (DefArt +) cn? drei (einiger Kinder) ? let g : Gender = genderAgr np.a in { - s = \\b,c => det.s ! b ! g ! c ++ appPrepNP vonDat np ++ bigNP np ; + s = \\b,c => det.s ! b ! g ! c ++ appPrepNP vonDat np ; a = agrgP3 g det.n ; w = case det.isDef of { True => WLight ; _ => WHeavy } ; rc = np.rc ; diff --git a/src/german/NumeralGer.gf b/src/german/NumeralGer.gf index eab2cc238..d2b7963d8 100644 --- a/src/german/NumeralGer.gf +++ b/src/german/NumeralGer.gf @@ -23,7 +23,8 @@ lin pot01 = { s = \\f => table { - NCard g c => "ein" + pronEnding ! GSg g ! c ; + NCard (AMod gn c) => "ein" + pronEnding ! gn ! c ; + NCard APred => "ein" ; NOrd af => (regA "erst").s ! Posit ! af } ; n = Sg @@ -40,22 +41,22 @@ lin pot1as2 n = n ; pot2 d = {s = \\g => - multiple (d.s ! DUnit) d.n ++ cardOrd "hundert" "hunderte" ! g ; n = Pl} ; + multiple (d.s ! DUnit) d.n ++ cardOrd "hundert" "hundertste" ! g ; n = Pl} ; pot2plus d e = {s = \\g => multiple (d.s ! DUnit) d.n ++ "hundert" ++ BIND ++ e.s ! g ; n = Pl} ; pot2as3 n = n ; pot3 n = {s = \\g => - multiple n.s n.n ++ cardOrd "tausend" "tausendte" ! g ; n = Pl} ; ---- + multiple n.s n.n ++ cardOrd "tausend" "tausendste" ! g ; n = Pl} ; pot3plus n m = {s = \\g => multiple n.s n.n ++ "tausend" ++ m.s ! g ; n = Pl} ; pot3as4 n = n ; pot3decimal d = {s = \\g => - d.s ! invNum ++ cardOrd "tausend" "tausendte" ! g ; n = Pl} ; ---- + d.s ! invNum ++ cardOrd "tausend" "tausendste" ! g ; n = Pl} ; pot4as5 n = n ; pot4decimal d = {s = \\g => - d.s ! invNum ++ cardOrd "Millionen" "Millionte" ! g ; n = Pl} ; ---- + d.s ! invNum ++ cardOrd "Millionen" "Millionste" ! g ; n = Pl} ; -- * 1 Million pot51 = {s = \\g => "einer Milliarde"; n = Pl} ; -- KA: case inflection missing @@ -69,32 +70,30 @@ oper Dig = TDigit ; lin - IDig d = {s = table{NCard g c => d.s ! NCard g c ; - NOrd APred => "am" ++ d.s ! invNum ++ BIND ++ "ten"; - NOrd amod => d.s ! NOrd amod} ; + IDig d = {s = d.s ; n = d.n ; isDig = True ; tail1to19 = notB d.isZero} ; - -- HL 11/2023 added case endings or ordinals to digits + -- HL 11/2023 added case endings of ordinals to digits -- NCard Masc Nom (= invNum): 0,1, 19, 20,21,... - -- NOrd (AMid (GSg Masc) Nom): 0ter,1ter,...,19ter, 20ster,21ster,...,99ster, 100ster + -- NOrd (AMod (GSg Masc) Nom): 0ter,1ter,...,19ter, 20ster,21ster,...,99ster, 100ster -- 101ter,...,119ter,120ster,... , 200ster IIDig d i = let isPld : Bool = case d.n of {Sg => False ; _ => True} ; b : Bool = case i.isDig of {True => isPld ; _ => notB i.tail1to19} ; i' : Digits = case b of {True => IDig (mkDig (i.s ! invNum ++ BIND ++ "s")) ; _ => i } - in {s = table {NCard g c => d.s ! invNum ++ BIND ++ i.s ! NCard g c ; - NOrd APred => "am" ++ d.s ! invNum ++ BIND ++ i'.s ! invNum ++ BIND ++ "ten" ; + in {s = table {NCard af => d.s ! invNum ++ BIND ++ i.s ! NCard af ; NOrd af => d.s ! invNum ++ BIND ++ i'.s ! NOrd af} ; n = Pl ; isDig = False ; - tail1to19 = case i.isDig of {True => notB isPld ; False => i.tail1to19} + tail1to19 = case i.isDig of {True => notB isPld ; False => i.tail1to19} ; + lock_Digits = <> } ; - D_0 = mk2Dig "0" Sg ** {isZero = True} ; - D_1 = mk2Dig "1" Sg ; + D_0 = mkDig "0" ** {isZero = True} ; + D_1 = mk2Dig "1" ; -- with cardinal inflection and number Sg D_2 = mkDig "2" ; D_3 = mkDig "3" ; D_4 = mkDig "4" ; @@ -106,32 +105,35 @@ oper PosDecimal d = d ** {hasDot=False} ; NegDecimal d = { - s = \\o => case o of { - NOrd APred => "am" ++ "-" ++ BIND ++ d.s ! NOrd (AMod GPl Dat) ; - _ => "-" ++ BIND ++ d.s ! o} ; + s = \\o => "-" ++ BIND ++ d.s ! o ; n = Pl ; hasDot=False } ; IFrac d i = { - s=\\o=>d.s ! invNum ++ - if_then_Str d.hasDot BIND (BIND++"."++BIND) ++ - i.s ! o; + s = \\o => d.s ! invNum ++ + if_then_Str d.hasDot BIND (BIND ++ "." ++ BIND) ++ + i.s ! o; n = Pl; hasDot=True } ; oper - mkDig : Str -> TDigit = \c -> mk2Dig c Pl ; - - mk2Dig : Str -> Number -> TDigit = \c,n -> mk3Dig c (c + "t") n ; -- like Duden 464 (4.Auflage) + mkDig : Str -> TDigit = \c -> mk3Dig c (c + "t") Pl ; -- like Duden 464 (4.Auflage) mk3Dig : Str -> Str -> Number -> TDigit = \c,o,n -> { - s = table {NCard _ _ => c ; -- 0,...,9 + s = table {NCard _ => c ; -- 0,...,9 NOrd af => (regA o).s ! Posit ! af} ; -- (ein) 0ter .. 9ter | (der) 0te ... 9te n = n ; -- NOrd APred: "0",... or "am 0ten",... ? isZero = False } ; + mk2Dig : Str -> TDigit = \crd -> + {s = table {NCard af => crd ; + NOrd af => (regA (crd + "t")).s ! Posit ! af} ; + n = Sg ; + isZero = False + } ; + TDigit = { n : Number ; s : CardOrd => Str ; diff --git a/src/german/ParadigmsGer.gf b/src/german/ParadigmsGer.gf index 6190f0117..7493d326d 100644 --- a/src/german/ParadigmsGer.gf +++ b/src/german/ParadigmsGer.gf @@ -579,16 +579,16 @@ mkV2 : overload { mkPrep = overload { mkPrep : Str -> Case -> Prep = \s,c -> - {s = \\_ => s ; s2 = [] ; c = c ; isPrep = isPrep ; lock_Prep = <>} ; + {s = \\_ => s ; s2 = [] ; c = c ; t = isPrep ; lock_Prep = <>} ; mkPrep : Case -> Str -> Prep = \c,s -> - {s = \\_ => [] ; s2 = s ; c = c ; isPrep = isPrep ; lock_Prep = <>} ; + {s = \\_ => [] ; s2 = s ; c = c ; t = isPrep ; lock_Prep = <>} ; mkPrep : Str -> Case -> Str -> Prep = \s,c,t -> - {s = \\_ => s ; s2 = t ; c = c ; isPrep = isPrep ; lock_Prep = <>} ; + {s = \\_ => s ; s2 = t ; c = c ; t = 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 = <>} ; + s2 = [] ; c = c ; t = isPrepDefArt ; lock_Prep = <>} ; mkPrep : Case -> Prep = \c -> - {s = \\_ => [] ; s2 = [] ; c = c ; isPrep = isCase ; lock_Prep = <>} + {s = \\_ => [] ; s2 = [] ; c = c ; t = isCase ; lock_Prep = <>} } ; accPrep = mkPrep accusative ; @@ -672,7 +672,7 @@ mkV2 : overload { = \v,c,d -> lin V3 (v ** {c2 = c ; c3 = d}) ; } ; - dirV3 v p = mkV3 v accPrep p ; -- accPrep sets isPrep=False + dirV3 v p = mkV3 v accPrep p ; -- accPrep, datPrep have t=isCase 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 28e03ae27..b492ac744 100644 --- a/src/german/PhraseGer.gf +++ b/src/german/PhraseGer.gf @@ -17,7 +17,7 @@ concrete PhraseGer of Phrase = CatGer ** open Prelude, ResGer in { UttVP vp = {s = useInfVP True vp} ; -- without zu UttAdv adv = adv ; UttCN n = {s = n.s ! Strong ! Sg ! Nom ++ n.adv ++ n.ext ++ n.rc ! Sg} ; - UttCard n = {s = n.s ! Neutr ! Nom} ; + UttCard n = {s = n.s ! AMod (GSg Neutr) Nom} ; UttAP ap = {s = ap.c.p1 ++ ap.s ! APred ++ ap.c.p2 ++ ap.ext} ; UttInterj i = i ; diff --git a/src/german/QuestionGer.gf b/src/german/QuestionGer.gf index 547eafda7..942a59ec4 100644 --- a/src/german/QuestionGer.gf +++ b/src/german/QuestionGer.gf @@ -90,7 +90,7 @@ concrete QuestionGer of Question = CatGer ** open ResGer in { let n = num.n in { - s = \\g,c => idet.s ! n ! g ! c ++ num.s!g!c ; + s = \\g,c => idet.s ! (gennum g n) ! c ++ num.s ! AMod (gennum g n) c ; n = n } ; diff --git a/src/german/ResGer.gf b/src/german/ResGer.gf index 8273913d3..8336d0c6f 100644 --- a/src/german/ResGer.gf +++ b/src/german/ResGer.gf @@ -28,7 +28,7 @@ resource ResGer = ParamX ** open Prelude in { -- Complex $CN$s, like adjectives, have strong and weak forms. - Adjf = Strong | Weak ; + Adjf = Strong | Weak | Mixed | MixedStrong ; -- Gender distinctions are only made in the singular. @@ -75,6 +75,10 @@ resource ResGer = ParamX ** open Prelude in { param NPForm = NPCase Case | NPPoss GenNum Case ; +-- Possessive pronouns have special forms for stand-alone usage as NP (mein.sp = meiner). + + param PossForm = PossF GenNum Case ; + -- Predeterminers sometimes require a case ("ausser mir"), sometimes not ("nur ich"). -- A number is sometimes inherited ("alle Menschen"), sometimes forced ("jeder von -- den Menschen"). @@ -147,7 +151,7 @@ resource ResGer = ParamX ** open Prelude in { --2 For $Numeral$ - CardOrd = NCard Gender Case | NOrd AForm ; + CardOrd = NCard AForm | NOrd AForm ; DForm = DUnit | DTeen | DTen ; --2 Transformations between parameter types @@ -166,7 +170,7 @@ resource ResGer = ParamX ** open Prelude in { Pl => GPl } ; --- Needed in $RelativeGer$. +-- Needed in $RelativeGer$ and $NounGer$. numGenNum : GenNum -> Number = \gn -> case gn of { @@ -174,24 +178,32 @@ resource ResGer = ParamX ** open Prelude in { GPl => Pl } ; + genGenNum : GenNum -> Gender = \gn -> + case gn of {GSg g => g ; GPl => Masc} ; + -- Used in $NounGer$. - agrAdj : Gender -> Adjf -> Number -> Case -> AForm = \g,a,n,c -> + agrAdj : Adjf -> GenNum -> Case -> AForm = \a,gn,c -> let - gn = gennum g n ; e = AMod (GSg Fem) Nom ; en = AMod (GSg Masc) Acc ; in case a of { Strong => AMod gn c ; - _ => case of { + Weak => case of { => e ; => en ; => e ; - _ => en - } + _ => en } ; + Mixed => case of { + => AMod gn c ; + _ => en } ; + MixedStrong => case of { + => en ; + _ => AMod gn c } } ; + -- This is used twice in NounGer. adjfCase : Adjf -> Case -> Adjf = \a,c -> case c of { @@ -307,8 +319,8 @@ resource ResGer = ParamX ** open Prelude in { {s = table { Posit => adjForms gut gute ; Compar => adjForms besser besser ; - Superl => adjForms ("am" ++ besten) best - } + Superl => adjForms besten best -- HL 12/2023: build ("am" ++ besten) via (OrdSuperl a) + } -- to get zweitbeste, am zweitbesten; *zweit am besten } ; -- Verbs need as many as 12 forms, to cover the variations with @@ -437,11 +449,11 @@ resource ResGer = ParamX ** open Prelude in { PrepType = isCase | isPrep | isPrepDefArt ; -- HL 7/2022 oper - Preposition : Type = {s : GenNum => Str ; s2:Str ; c : Case ; isPrep : PrepType} ; + Preposition : Type = {s : GenNum => Str ; s2:Str ; c : Case ; t : PrepType} ; - isaCase : Preposition -> Bool = \p -> case p.isPrep of {isCase => True ; _ => False} ; - isaPrep : Preposition -> Bool = \p -> case p.isPrep of {isPrep => True ; _ => False} ; - isaPrepDefArt : Preposition -> Bool = \p -> case p.isPrep of {isPrepDefArt => True ; _ => False} ; + isaCase : Preposition -> Bool = \p -> case p.t of {isCase => True ; _ => False} ; + isaPrep : Preposition -> Bool = \p -> case p.t of {isPrep => True ; _ => False} ; + isaPrepDefArt : Preposition -> Bool = \p -> case p.t of {isPrepDefArt => True ; _ => False} ; -- To apply a preposition to a complement. @@ -452,7 +464,7 @@ resource ResGer = ParamX ** open Prelude in { let g : Gender = genderAgr np.a ; n : Number = numberAgr np.a ; - glues = case of { => True ; _ => False} ; + glues = case of { => True ; _ => False} ; nps = np.s ! glues ! prep.c in case of { @@ -476,19 +488,19 @@ resource ResGer = ParamX ** open Prelude in { -- 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} ; + {s = \\_ => [] ; s2 = [] ; c = c ; t = 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 = []} ; + PrepNom : Preposition = {s = \\_ => [] ; t = isCase ; c = Nom ; s2 = []} ; vonDat : Preposition = {s=table{GPl => "von" ; GSg Fem => "von der"; _ => "vom"}; - s2=[]; c=Dat; isPrep=isPrepDefArt} ; + s2=[]; c=Dat; t=isPrepDefArt} ; -- To build passive: accusative object -> nom subject; others -> same case or prep subjPrep : Preposition -> Preposition = \prep -> - case of { + case of { => prep ** {c = Nom} ; _ => prep } ; @@ -498,7 +510,7 @@ resource ResGer = ParamX ** open Prelude in { -- All personal pronouns, except "ihr", conform to the simple pattern $mkPronPers$. mkPronPers : (x1,_,_,_,x5 : Str) -> Gender -> Number -> Person -> - {s : NPForm => Str ; a : Agr} = + {s : NPForm => Str ; a : Agr ; sp : PossForm => Str} = \ich,mich,mir,meiner,mein,g,n,p -> { s = table { NPCase c => caselist ich mich mir meiner ! c ; @@ -515,13 +527,16 @@ resource ResGer = ParamX ** open Prelude in { => AgSgP3 g ; <_,Sg,P1> => AgSgP1 ; <_,Sg,P2> => AgSgP2 -- for "man", "Sie", set in StructuralGer HL - } + } ; + sp = table {PossF (GSg Masc) Nom => mein + "er" ; -- HL 12/23 + PossF (GSg Neutr) (Nom|Acc) => mein + "es" ; + PossF gn c => mein + (pronEnding ! gn ! c)} ; } ; pronEnding : GenNum => Case => Str = table { GSg Masc => caselist "" "en" "em" "es" ; GSg Fem => caselist "e" "e" "er" "er" ; - GSg Neutr => caselist "" "" "em" "es" ; + GSg Neutr => caselist "" "" "em" "es" ; GPl => caselist "e" "e" "en" "er" } ; @@ -544,16 +559,16 @@ resource ResGer = ParamX ** open Prelude in { -- This auxiliary gives the forms in each degree of adjectives. adjForms : (x1,x2 : Str) -> AForm => Str = \teuer,teur -> - table { - APred => teuer ; - AMod (GSg Masc) c => - caselist (teur+"er") (teur+"en") (teur+"em") (teur+"en") ! c ; - AMod (GSg Fem) c => - caselist (teur+"e") (teur+"e") (teur+"er") (teur+"er") ! c ; - AMod (GSg Neutr) c => - caselist (teur+"es") (teur+"es") (teur+"em") (teur+"en") ! c ; - AMod GPl c => - caselist (teur+"e") (teur+"e") (teur+"en") (teur+"er") ! c + table { + APred => teuer ; + AMod gn c => teur + adjEnding ! gn ! c -- Strong Adjf + } ; + + adjEnding : GenNum => Case => Str = table { + GSg Masc => caselist "er" "en" "em" "en" ; + GSg Fem => caselist "e" "e" "er" "er" ; + GSg Neutr => caselist "es" "es" "em" "en" ; + GPl => caselist "e" "e" "en" "er" } ; -- for some determiners, Gen form -es rather than -en @@ -565,6 +580,13 @@ resource ResGer = ParamX ** open Prelude in { a => adj ! a } ; + detEnding : GenNum => Case => Str = table { + GSg Masc => caselist "er" "en" "em" "es" ; + GSg Fem => caselist "e" "e" "er" "er" ; + GSg Neutr => caselist "es" "es" "em" "es" ; + GPl => caselist "e" "e" "en" "er" + } ; + -------------------------------------------- --VP CONSTRUCTION -------------------------------------------- @@ -744,7 +766,7 @@ resource ResGer = ParamX ** open Prelude in { insertObjNP : NP -> Preposition -> VPSlash -> VPSlash = \np,prep,vp -> let obj = appPrepNP prep np ; - b : Bool = case prep.isPrep of {isPrep | isPrepDefArt => True ; _ => False} ; + b : Bool = case prep.t of {isPrep | isPrepDefArt => True ; _ => False} ; w = np.w ; c = prep.c in insertObj' obj b w c vp ; @@ -779,7 +801,7 @@ resource ResGer = ParamX ** open Prelude in { in vp ** { nn = \\a => let vpnn = vp.nn ! a in - case prep.isPrep of { + case prep.t of { isCase => ; _ => } } ; diff --git a/src/german/StructuralGer.gf b/src/german/StructuralGer.gf index 2e52ad833..e54a65dd3 100644 --- a/src/german/StructuralGer.gf +++ b/src/german/StructuralGer.gf @@ -33,12 +33,14 @@ concrete StructuralGer of Structural = CatGer ** 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 Masc {s = caselist "jeder" "jeden" "jedem" "jedes"} ; - every_Det = let tab = (detUnlikeAdj False Sg "jed").s - in {s,sp = asQuant tab ; n = Sg ; a = Weak ; isDef = False ; hasDefArt = False} ; + every_Det = { + s,sp = \\_,g,c => "jed" + detEnding ! (gennum g Sg) ! c ; + n = Sg ; a = Weak ; isDef = False ; hasDefArt = False} ; everything_NP = nameNounPhrase Neutr {s = caselist "alles" "alles" "allem" "alles"} ; everywhere_Adv = ss "überall" ; - few_Det = let tab = (detLikeAdj False Pl "wenig").s - in {s,sp = asQuant tab ; n = Pl ; a = Weak ; isDef = False ; hasDefArt = False} ; + few_Det = { + s,sp = \\_,g,c => "wenig" + adjEnding ! (gennum g Pl) ! c ; + n = Pl ; a = Strong ; isDef = False ; hasDefArt = False} ; ---- first_Ord = {s = (regA "erst").s ! Posit} ; for_Prep = mkPrep "für" P.accusative ; from_Prep = mkPrep "aus" P.dative ; @@ -48,26 +50,29 @@ concrete StructuralGer of Structural = CatGer ** here_Adv = ss "hier" ; how_IAdv = ss "wie" ; how8much_IAdv = ss "wieviel" ; - how8many_IDet = {s = \\g,c => (detUnlikeAdj False Pl "wie viel").s ! g ! c ; n = Pl} ; + how8many_IDet = {s = \\g,c => "wie viel" + detEnding ! (gennum g Pl) ! c ; n = Pl} ; 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 = 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} ; + many_Det = { + s,sp = \\_,g,c => "viel" + adjEnding ! (gennum g Pl) ! c ; + n = Pl ; a = Strong ; 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 in - R.artDef ! gn ! c ++ adj ! (agrAdj g Weak n c) ; + R.artDef ! gn ! c ++ adj ! (agrAdj Weak gn 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} ; + much_Det = { + s = \\_,g,c => "viel" ; + sp = \\_,g,c => "viel" + detEnding ! (gennum g Sg) ! c ; ---- (GSg _ Sg) ! Gen ? + n = Sg ; a = Strong ; isDef = False ; hasDefArt = False} ; must_VV = auxVV (mkV "müssen" "muss" "musst" "muss" "müsst" "müss" @@ -88,31 +93,28 @@ concrete StructuralGer of Structural = CatGer ** 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 ; n = Pl ; a = Weak ; isDef = True ; hasDefArt = False} ; + somePl_Det = { + s,sp = \\_,g,c => "einig" + adjEnding ! (gennum g Pl) ! c ; + n = Pl ; a = Strong ; 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 - } ; + s = \\_,g,c => "ein" + pronEnding ! GSg g ! c ; -- ein, eine, ein + sp = \\_,g,c => "ein" + detEnding ! GSg g ! c ; -- einer, eine, eines + n = Sg ; a = Mixed ; 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 - {s,sp = \\_,_ => jener ; a,aPl = Weak ; hasDefArt = False} ; + that_Quant = let jener : GenNum => Case => Str = \\gn,c => "jen" + detEnding ! gn ! c + in {s = \\_ => jener ; sp = jener ; a = Weak ; isDefArt,delCardOne = False} ; ---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"] ; therefore_PConj = ss "deshalb" ; ---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 - {s,sp = \\_,_ => dieser ; a,aPl = Weak ; hasDefArt = False} ; + this_Quant = let dieser : GenNum => Case => Str = \\gn,c => "dies" + detEnding ! gn ! c + in {s = \\_ => dieser ; sp = dieser ; a = Weak ; isDefArt, delCardOne = False} ; ---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 ; @@ -134,8 +136,7 @@ concrete StructuralGer of Structural = CatGer ** when_IAdv = ss "wann" ; when_Subj = ss "wenn" ; where_IAdv = ss "wo" ; - which_IQuant = {s = \\n,g,c => (detUnlikeAdj True n "welch").s ! g ! c} ; - + which_IQuant = {s = \\gn,c => "welch" + detEnding ! gn ! c} ; whoSg_IP = {s = caselist "wer" "wen" "wem" "wessen" ; n = Sg} ; whoPl_IP = {s = caselist "wer" "wen" "wem" "wessen" ; n = Sg} ; -- HL 6/2016 why_IAdv = ss "warum" ; @@ -147,13 +148,11 @@ concrete StructuralGer of Structural = CatGer ** yes_Utt = ss "ja" ; not_Predet = {s = \\_,_,_ => "nicht" ; c = noCase ; a = PAgNone} ; - no_Quant = let - keiner : Number => Gender => Case => Str = table { - Sg => \\g,c => "kein" + pronEnding ! GSg g ! c ; - Pl => (detUnlikeAdj False Pl "kein").s - } - in - {s,sp = \\_,_ => keiner ; a = Strong ; aPl = Weak ; hasDefArt = False} ; ---- sp + no_Quant = { + s = \\_ => table {GSg g => \\c => "kein" + pronEnding ! GSg g ! c ; + GPl => \\c => "kein" + detEnding ! GPl ! c} ; + sp = \\gn,c => "kein" + detEnding ! gn ! c ; + a = Mixed ; isDefArt = False ; delCardOne = True} ; -- HL kein+ein(er) => kein(er) if_then_Conj = {s1 = "wenn" ; s2 = "dann" ; n = Sg ; lock_Conj = <>} ; nobody_NP = nameNounPhrase Masc {s = caselist "niemand" "niemanden" "niemandem" "niemands"} ; @@ -170,13 +169,13 @@ 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) ; + appAdjDegAdjf : Adjective -> Degree -> Adjf -> GenNum => Case => Str = + \adj,deg,adjf -> \\gn,c => adj.s ! deg ! (agrAdj adjf gn c) ; + -- (detLikeAdj b n str).s = \\g,c => str + adjEnding ! (gennum g n) ! c + -- (detUnLikeAdj b n str).s = \\g,c => str + detEnding ! (gennum g n) ! c } diff --git a/src/german/SymbolGer.gf b/src/german/SymbolGer.gf index 42b224321..7bb6563f1 100644 --- a/src/german/SymbolGer.gf +++ b/src/german/SymbolGer.gf @@ -6,32 +6,32 @@ lin SymbPN i = {s = \\c => i.s ; g = Neutr ; n = Sg} ; --- c IntPN i = {s = \\c => i.s ; g = Neutr ; n = Sg} ; --- c FloatPN i = {s = \\c => i.s ; g = Neutr ; n = Sg} ; --- c - NumPN i = {s = i.s ! Neutr ; g = Neutr ; n = Sg} ; --- c + NumPN i = {s = \\c => i.s ! APred ; g = Neutr ; n = Sg} ; --- c -- HL CNIntNP cn i = { s = \\_,c => cn.s ! Weak ! Sg ! Nom ++ i.s ; a = agrP3 Sg ; w = WLight ; - ext,rc = [] -- added + ext,rc = [] } ; CNSymbNP det cn xs = let g = cn.g in { s = \\b,c => det.s ! b ! g ! c ++ cn.s ! adjfCase det.a c ! det.n ! c ++ xs.s ; a = agrP3 det.n ; w = WLight ; - ext,rc = [] -- added + ext,rc = [] } ; CNNumNP cn i = { s = \\b,c => case b of {True => [] ; False => artDef ! (GSg cn.g) ! c} - ++ cn.s ! Weak ! Sg ! Nom ++ i.s ! Neutr ! c ; + ++ cn.s ! Weak ! Sg ! Nom ++ i.s ! AMod (GSg Neutr) c ; a = agrgP3 cn.g Sg ; -- HL 27.9.2023 w = WDefArt ; -- im Haus 14 - ext,rc = [] -- added + ext,rc = [] } ; SymbS sy = {s = \\_ => sy.s} ; - SymbNum n = {s = \\_,_ => n.s ; n = Pl ; isNum = True} ; - SymbOrd n = {s = \\_ => glue n.s "."} ; + SymbNum n = {s = \\_ => n.s ; n = Pl ; isNum = True} ; + SymbOrd n = {s = \\_ => glue n.s "."} ; lincat diff --git a/src/german/TerminologyGer.gf b/src/german/TerminologyGer.gf index 569acd925..3c1f1ea4f 100644 --- a/src/german/TerminologyGer.gf +++ b/src/german/TerminologyGer.gf @@ -1,7 +1,7 @@ --# -path=.:../abstract:../common concrete TerminologyGer of Terminology = CatGer ** open - ResGer, + (R = ResGer), ParadigmsGer, (G = GrammarGer), (S = SyntaxGer), @@ -59,8 +59,8 @@ lin superlative_Parameter = mkN "Superlativ" ; predicative_Parameter = mkN "Prädikativ" ; - nounHeading n = ss (n.s ! Sg ! Nom) ; + nounHeading n = ss (n.s ! R.Sg ! R.Nom) ; exampleGr_N = mkN "Beispiel" "Beispiele" neuter ; -} \ No newline at end of file +} diff --git a/src/german/VerbGer.gf b/src/german/VerbGer.gf index f24dda48a..d5688a3be 100644 --- a/src/german/VerbGer.gf +++ b/src/german/VerbGer.gf @@ -37,7 +37,7 @@ concrete VerbGer of Verb = CatGer ** open Prelude, ResGer, Coordination in { insertInf inf vps) ** {c2 = v.c2 ; objCtrl = v.objCtrl} ; SlashV2A v ap = - insertAdj (ap.s ! APred) ap.c ap.ext (predV v) ** {c2 = v.c2; objCtrl = False} ; + insertAdj (ap.s ! APred ++ ap.s2 ! Nom) ap.c ap.ext (predV v) ** {c2 = v.c2; objCtrl = False} ; ComplSlash vps np = -- IL 24/04/2018 force reflexive in the VPSlash to take the agreement of np. @@ -95,7 +95,7 @@ concrete VerbGer of Verb = CatGer ** open Prelude, ResGer, Coordination in { -- 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} ; + b : Bool = case prep.t of {isPrep | isPrepDefArt => True ; _ => False} ; c = prep.c ; w = np.w ; vps = (ComplVV v vp ** {c2 = vp.c2 ; objCtrl = vp.objCtrl}) @@ -132,7 +132,7 @@ concrete VerbGer of Verb = CatGer ** open Prelude, ResGer, Coordination in { ReflVP vp = insertObjRefl vp ; -- HL, 19/06/2019 PassV2 v = -- acc object -> nom subject; all others: same PCase - let c = case of { + let c = case of { => Nom ; _ => v.c2.c} in insertObj (\\_ => v.s ! VPastPart APred) (predV werdenPass) ** { c1 = v.c2 ** {c = c} } ; diff --git a/src/greek/NumeralGre.gf b/src/greek/NumeralGre.gf index 1c3eddd1d..15f4da147 100644 --- a/src/greek/NumeralGre.gf +++ b/src/greek/NumeralGre.gf @@ -302,7 +302,7 @@ Xilias : CardOrd -> (CardOrd => Str) -> Number -> Str = \co,d,n -> if_then_Str d.hasDot BIND (BIND++"."++BIND) ++ i.s ! o ; n = Pl ; - hasDot=False + hasDot=True } ; oper diff --git a/src/russian/CatRus.gf b/src/russian/CatRus.gf index 9aa05bf64..8f5f89b84 100644 --- a/src/russian/CatRus.gf +++ b/src/russian/CatRus.gf @@ -72,13 +72,12 @@ lincat Det, DAP = { s : DetTable ; type : DetType ; -- main purpose is to avoid emptiness of articles, but can be reused later for something else - g : Gender ; c : Case ; size : NumSize } ; Predet = ResRus.Adjective ** {size : NumSize} ; IQuant = ResRus.Adjective ** {g: Gender; c: Case} ; - Quant = ResRus.Adjective ** {g: Gender; c: Case; type: DetType} ; + Quant = ResRus.Adjective ** {c: Case; type: DetType} ; Numeral = NumeralForms ; Num = NumDet ; Card = NumDet ; diff --git a/src/russian/ConjunctionRus.gf b/src/russian/ConjunctionRus.gf index 0084d82fc..aee6a372b 100644 --- a/src/russian/ConjunctionRus.gf +++ b/src/russian/ConjunctionRus.gf @@ -15,7 +15,6 @@ concrete ConjunctionRus of Conjunction = preferShort : ShortFormPreference } ; [DAP] = {s1,s2 : DetTable ; - g : Gender ; c : Case ; size : NumSize } ; @@ -67,7 +66,6 @@ concrete ConjunctionRus of Conjunction = -- : DAP -> DAP -> ListDAP ; -- BaseDAP x y = twoTable3 Gender Animacy Case x y ** { - g = conjGender x.g y.g ; c = y.c ; size = conjSize x.size y.size ; -- different genders -> plural? } ; diff --git a/src/russian/DocumentationRusFunctor.gf b/src/russian/DocumentationRusFunctor.gf index 397651cd3..c0a96d8f8 100644 --- a/src/russian/DocumentationRusFunctor.gf +++ b/src/russian/DocumentationRusFunctor.gf @@ -4,10 +4,6 @@ incomplete concrete DocumentationRusFunctor of Documentation = CatRus ** open Terminology, -- the interface ResRus, ParadigmsRus, - (G = GrammarRus), - (S = SyntaxRus), - (ST = StructuralRus), - (L = LexiconRus), Prelude, HTML in { @@ -151,85 +147,22 @@ lin }) } ; - InflectionV v = { + InflectionV, InflectionV2, InflectionV3, + InflectionV2V, InflectionV2S, InflectionV2Q, + InflectionV2A, InflectionVS, InflectionVQ, + InflectionVA = \v -> { t = "гл" ; - s1 = heading1 (heading verb_Category) ++ - paragraph (verbExample (S.mkCl S.she_NP v)) ; - s2 = inflVerb v - } ; - - InflectionV2 v = { - t = "гл" ; - s1 = heading1 (heading verb_Category) ++ - paragraph (verbExample (S.mkCl S.she_NP v S.something_NP)) ; - s2 = inflVerb v - } ; - - InflectionV3 v = { - t = "гл" ; - s1 = heading1 (heading verb_Category) ++ - paragraph (verbExample (S.mkCl S.she_NP v S.something_NP S.something_NP)) ; - s2 = inflVerb v - } ; - - InflectionV2V v = { - t = "гл" ; - s1 = heading1 (heading verb_Category) ++ - paragraph (verbExample (S.mkCl S.she_NP v S.we_NP (S.mkVP (L.sleep_V)))) ; - s2 = inflVerb v - } ; - - InflectionV2S v = { - t = "гл" ; - s1 = heading1 (heading verb_Category) ++ - paragraph (verbExample (S.mkCl S.she_NP v S.we_NP (lin S {s : Mood=>Str = \\m=>"..."}))) ; - s2 = inflVerb v - } ; - - InflectionV2Q v = { - t = "гл" ; - s1 = heading1 (heading verb_Category) ++ - paragraph (verbExample (S.mkCl S.she_NP v S.we_NP (lin QS {s: QForm=>Str = \\m=>"..."}))) ; - s2 = inflVerb v - } ; - - InflectionV2A v = { - t = "гл" ; - s1 = heading1 (heading verb_Category) ++ - paragraph (verbExample (S.mkCl S.she_NP v S.we_NP L.beautiful_A)) ; + s1 = heading1 (heading verb_Category) ; s2 = inflVerb v } ; InflectionVV vv = { t = "гл" ; - s1 = heading1 (heading verb_Category) ++ - paragraph (verbExample (S.mkCl S.she_NP vv (S.mkVP (L.sleep_V)))) ; + s1 = heading1 (heading verb_Category) ; s2 = inflVerb vv.v } ; - InflectionVS v = { - t = "гл" ; - s1 = heading1 (heading verb_Category) ++ - paragraph (verbExample (S.mkCl S.she_NP v (lin S {s : Mood=>Str = \\m=>"..."}))) ; - s2 = inflVerb v - } ; - - InflectionVQ v = { - t = "гл" ; - s1 = heading1 (heading verb_Category) ++ - paragraph (verbExample (S.mkCl S.she_NP v (lin QS {s : Mood=>Str = \\m=>"..."}))) ; - s2 = inflVerb v - } ; - - InflectionVA v = { - t = "гл" ; - s1 = heading1 (heading verb_Category) ++ - paragraph (verbExample (S.mkCl S.she_NP v L.beautiful_A)) ; - s2 = inflVerb v - } ; - oper - verbExample : CatRus.Cl -> Str = \cl -> (S.mkUtt cl).s ; {- -} --# notpresent inflVerb : CatRus.V -> Str = \v -> diff --git a/src/russian/ExtendRus.gf b/src/russian/ExtendRus.gf index 5c97b8e50..39b8bc73b 100644 --- a/src/russian/ExtendRus.gf +++ b/src/russian/ExtendRus.gf @@ -218,7 +218,7 @@ lin } ; UseDAP det = - let g = det.g in { + let g = Neut in { s=case det.type of { EmptyIndef => \\cas => a_Det.s ! g ! Inanimate ! cas ++ det.s ! g ! Inanimate ! cas ; EmptyDef => \\cas => the_Det.s ! g ! Inanimate ! cas ++ det.s ! g ! Inanimate ! cas ; diff --git a/src/russian/NamesRus.gf b/src/russian/NamesRus.gf index 720543bea..29fee8143 100644 --- a/src/russian/NamesRus.gf +++ b/src/russian/NamesRus.gf @@ -26,7 +26,7 @@ lin PlSurname sn = } ; -- Does NP need animacy? lin FullName gn sn = - { s=\\cas => gn.s ! Nom ++ sn.s ! gn.g ! cas ; + { s=\\cas => gn.s ! cas ++ sn.s ! gn.g ! cas ; pron=False; a=let g = case gn.g of { Male => Masc ; diff --git a/src/russian/NounRus.gf b/src/russian/NounRus.gf index 83cbc3ffe..201621c44 100644 --- a/src/russian/NounRus.gf +++ b/src/russian/NounRus.gf @@ -45,7 +45,7 @@ lin -- : Det -> NP ; -- these five DetNP det = - let g = det.g in { + let g = Neut in { s=case det.type of { EmptyIndef => \\cas => a_Det.s ! g ! Inanimate ! cas ++ det.s ! g ! Inanimate ! cas ; EmptyDef => \\cas => the_Det.s ! g ! Inanimate ! cas ++ det.s ! g ! Inanimate ! cas ; @@ -102,7 +102,7 @@ lin DetQuantOrd quant num ord = { s=\\g,a,cas => num.s ! g ! a ! cas ++ quant.s ! (gennum g (numSizeNumber num.size)) ! a ! cas - ++ (adjFormsAdjective ord).s ! gennum quant.g (animNumSizeNum Inanimate cas num.size) ! Inanimate ! numSizeCase cas num.size ; + ++ (adjFormsAdjective ord).s ! gennum g (animNumSizeNum Inanimate cas num.size) ! Inanimate ! numSizeCase cas num.size ; type=quant.type ; g=quant.g ; c=quant.c ; @@ -139,7 +139,6 @@ lin s=mkPronTable pron.poss ; type=NormalDet ; short=\\a=>[] ; - g=Neut ; c=Nom ; preferShort=PreferFull } ; @@ -192,7 +191,7 @@ lin -- : CN -> NP -> CN ; -- house of Paris, house of mine PossNP cn np = cn ** { - s=\\n,cas => np.s ! Gen ++ cn.s ! n ! cas ; -- TODO: possessive pronouns P1, P2 + s=\\n,cas => cn.s ! n ! cas ++ np.s ! Gen ; -- TODO: possessive pronouns P1, P2 } ; -- : CN -> NP -> CN ; -- glass of wine - стакан чаю (чая) @@ -226,7 +225,6 @@ lin type=EmptyDef ; short=\\a=>[] ; c=Nom ; - g=Neut ; size=Num1 ; preferShort=PreferFull } ; @@ -236,7 +234,6 @@ lin type=EmptyIndef ; short=\\a=>[] ; c=Nom ; - g=Neut ; size=Num1 ; preferShort=PreferFull } ; diff --git a/src/russian/ParadigmsRus.gf b/src/russian/ParadigmsRus.gf index 8284b133d..36f7917b3 100644 --- a/src/russian/ParadigmsRus.gf +++ b/src/russian/ParadigmsRus.gf @@ -511,6 +511,10 @@ oper = \a, ln -> ln ** { s = \\cas => (adjFormsAdjective a).s ! (gennum ln.g ln.n) ! ln.anim ! cas ++ ln.s ! cas } ; + mkLN : LN -> Str -> LN + = \ln, suffix -> ln ** { + s = \\cas => ln.s ! cas ++ suffix + } ; } ; invarLN : Str -> Gender -> Number -> LN diff --git a/src/russian/StructuralRus.gf b/src/russian/StructuralRus.gf index b409ba609..599ccc358 100644 --- a/src/russian/StructuralRus.gf +++ b/src/russian/StructuralRus.gf @@ -27,21 +27,18 @@ lin this_Quant = (adjFormsAdjective this_forms) ** { type=NormalDet ; preferShort=PreferFull ; - g=Neut ; c=Nom } ; -- : Quant ; that_Quant = (adjFormsAdjective that_forms) ** { type=NormalDet ; preferShort=PreferFull ; - g=Neut ; c=Nom } ; -- : Quant ; no_Quant = (adjFormsAdjective (makeAdjectiveForms "никакой" "" "3b" PreferFull)) ** { type=NormalDet ; preferShort=PreferFull ; - g=Neut ; c=Nom } ; @@ -193,4 +190,4 @@ lin language_title_Utt = ss "русский" ; yes_Utt = ss ["да"] ; no_Utt = ss ["нет"] ; -} \ No newline at end of file +} diff --git a/src/russian/VerbRus.gf b/src/russian/VerbRus.gf index 88d535631..e37732f72 100644 --- a/src/russian/VerbRus.gf +++ b/src/russian/VerbRus.gf @@ -188,15 +188,15 @@ lin }; -- : NP -> Comp ; -- (be) the man - CompNP np = {s=\\a=>np.s ! Ins ; adv=[] ; cop=InsCopula} ; + CompNP np = {s=\\a=>np.s ! Nom ; adv=[] ; cop=NomCopula} ; -- : Adv -> Comp ; -- (be) here CompAdv adv = {s=\\a=>[] ; adv=adv.s ; cop=ExplicitCopula} ; -- : CN -> Comp ; -- (be) a man/men CompCN cn = { - s=\\a=>cn.s ! numGenNum (agrGenNum a) ! Ins ; + s=\\a=>cn.s ! numGenNum (agrGenNum a) ! Nom ; adv=[] ; - cop=InsCopula + cop=NomCopula } ; -- : VP ; -- be diff --git a/src/turkish/ExtendTur.gf b/src/turkish/ExtendTur.gf index 775457b77..195f1bc52 100644 --- a/src/turkish/ExtendTur.gf +++ b/src/turkish/ExtendTur.gf @@ -7,4 +7,6 @@ concrete ExtendTur of Extend = CatTur ** open ResTur in { a = {n=num.n; p=P3} ; } ; + TPastSimple = {s = []} ** {t = Past} ; --# notpresent + } diff --git a/tests/german/TestLangGer.gf b/tests/german/TestLangGer.gf index 52213c976..80e24c529 100644 --- a/tests/german/TestLangGer.gf +++ b/tests/german/TestLangGer.gf @@ -69,6 +69,7 @@ concrete TestLangGer of TestLang = 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 ; + s2 = \\_ => [] ; isPre = True ; c = <[],[]> ; adj = [] ; @@ -183,7 +184,7 @@ gr -tr (PredVP (UsePron ?) (ComplSlash (SlashV2V lassen_V2V (ReflVP (SlashV2a wa s = \\m,t,a,p => let cls = slash.s ! m ! t ! a ! p ; - who = appPrepC slash.c2 ip.s ; + who = appPrep slash.c2 ip.s ; in table { QDir => who ++ cls ! Inv ! (RGenNum gn); QIndir => who ++ cls ! Sub ! (RGenNum gn) @@ -201,10 +202,10 @@ gr -tr (PredVP (UsePron ?) (ComplSlash (SlashV2V lassen_V2V (ReflVP (SlashV2a wa } ; SlashVS np vs slash = - let subj = mkSubj np PrepNom ; + let subj = mkSubject 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 ; + in mkClSlash subj.s subj.a vps ; UseSlash t p cl = { s = \\o => t.s ++ p.s ++ cl.s ! t.m ! t.t ! t.a ! p.p ! o ! RSentence ; @@ -213,9 +214,9 @@ gr -tr (PredVP (UsePron ?) (ComplSlash (SlashV2V lassen_V2V (ReflVP (SlashV2a wa oper gnToAgr : RelGenNum -> Agr = \gn -> - case gn of {RGenNum (GSg g) => Ag g Sg P3 ; - RGenNum GPl => Ag Neutr Pl P3 ; - RSentence => Ag Neutr Sg P3} ; + case gn of {RGenNum (GSg g) => AgSgP3 g ; + RGenNum GPl => AgPl P3 ; + RSentence => AgSgP3 Neutr} ; mkClSlash : Str -> Agr -> ResGer.VPSlash -> ClauseSlash = \subj,agr,vp -> @@ -227,7 +228,8 @@ gr -tr (PredVP (UsePron ?) (ComplSlash (SlashV2V lassen_V2V (ReflVP (SlashV2a wa Sub => True ; -- glue prefix to verb _ => False } ; - verb = vps.s ! ord ! agr ! VPFinite m t a ; + vagr = agr2vagr agr ; + verb = vps.s ! ord ! vagr ! VPFinite m t a ; haben = verb.inf2 ; neg = negation ! b ; ag : Agr = case vp.objCtrl of {True => gnToAgr gn ; _ => agr} ; diff --git a/tests/german/TestLexiconEng.gf b/tests/german/TestLexiconEng.gf index 0f4852449..e7c222932 100644 --- a/tests/german/TestLexiconEng.gf +++ b/tests/german/TestLexiconEng.gf @@ -51,8 +51,6 @@ lin kaufen_bei_fuer_V4 = dirV4 (irregV "buy" "bought" "bought") (mkPrep "from") (mkPrep "for") ; mieten_von_fuer_V4 = dirV4 (regV "rent") (mkPrep "from") (mkPrep "for") ; - neugierig_auf_A2 = mkA2 (regA "curious") (mkPrep "about") ; - wagen_VV = mkVV (regV "dare") ; -- typ=VVInf versuchen_VV = mkVV (irregV "try" "tried" "tried") ; -- typ=VVInf helfen_V2V = defaultV2V (regV "help") ; @@ -62,4 +60,10 @@ lin -- aci verb: sehen_V2V = mkV2V (I.see_V) ; hoeren_V2V = mkV2V (I.hear_V) ; + + -- Adjectives + + neugierig_auf_A2 = mkA2 (regA "curious") (mkPrep "about") ; + treu_A2 = mkA2 (compoundA (mkA "faithful")) (mkPrep "to") ; + stolz_A2 = mkA2 (mkA "proud" "prouder") (mkPrep "of") ; } diff --git a/tests/german/TestLexiconGer.gf b/tests/german/TestLexiconGer.gf index 38baf2970..40bdbb221 100644 --- a/tests/german/TestLexiconGer.gf +++ b/tests/german/TestLexiconGer.gf @@ -55,8 +55,6 @@ lin kaufen_bei_fuer_V4 = dirV4 (regV "kaufen") bei_Prep fuer_Prep ; mieten_von_fuer_V4 = dirV4 (regV "mieten") von_Prep fuer_Prep ; - neugierig_auf_A2 = mkA2 (mk3A "neugierig" "neugieriger" "neugierigste") (mkPrep "auf" accusative) ; - -- verbs with infinitival object (non-modal): wagen_VV = mkVV (regV "wagen") ; versuchen_VV = mkVV (irregV "versuchen" "versucht" "versuchte" "versuchte" "versucht") ; @@ -72,4 +70,11 @@ lin -- aci verb: sehen_V2V = auxV2V (irregV "sehen" "sieht" "sah" "sähe" "gesehen") accPrep ; hoeren_V2V = auxV2V (regV "hören") accPrep ; + + -- Adjectives + + neugierig_auf_A2 = mkA2 (mk3A "neugierig" "neugieriger" "neugierigste") (mkPrep "auf" accusative) ; + treu_A2 = mkA2 (mk3A "treu" "treuer" "treueste") datPrep ; + stolz_A2 = mkA2 (mk3A "stolz" "stolzer" "stolzeste") (mkPrep "auf" accusative) ; + } diff --git a/tests/german/TestLexiconGerAbs.gf b/tests/german/TestLexiconGerAbs.gf index aa3113eef..c475c3ec8 100644 --- a/tests/german/TestLexiconGerAbs.gf +++ b/tests/german/TestLexiconGerAbs.gf @@ -24,8 +24,6 @@ fun entschuldigen_bei_fuer_rV3 : V3 ; raechen_am_fuer_rV3 : V3 ; - neugierig_auf_A2 : A2 ; - wagen_VV : VV ; versuchen_VV : VV ; @@ -43,4 +41,10 @@ fun kaufen_bei_fuer_V4 : V4 ; mieten_von_fuer_V4 : V4 ; + -- Adjectives + + neugierig_auf_A2 : A2 ; + treu_A2 : A2 ; -- Ger: dative complement + stolz_A2 : A2 ; + }