diff --git a/lib/resource-1.0/german/AdjectiveGer.gf b/lib/resource-1.0/german/AdjectiveGer.gf index 53fe467ab..897eff38d 100644 --- a/lib/resource-1.0/german/AdjectiveGer.gf +++ b/lib/resource-1.0/german/AdjectiveGer.gf @@ -9,7 +9,7 @@ concrete AdjectiveGer of Adjective = CatGer ** open ResGer, Prelude in { isPre = True } ; ComparA a np = { - s = \\af => a.s ! Compar ! af ++ "als" ++ np.s ! Nom ; + s = \\af => a.s ! Compar ! af ++ conjThan ++ np.s ! Nom ; isPre = True } ; diff --git a/lib/resource-1.0/german/CatGer.gf b/lib/resource-1.0/german/CatGer.gf index 15a57cf19..bc4cc4fff 100644 --- a/lib/resource-1.0/german/CatGer.gf +++ b/lib/resource-1.0/german/CatGer.gf @@ -38,7 +38,7 @@ concrete CatGer of Cat = open ResGer, Prelude in { Det, Quant = {s : Gender => Case => Str ; n : Number ; a : Adjf} ; Predet = {s : Number => Gender => Case => Str} ; Num = {s : Gender => Case => Str} ; - Ord = {s : Adjf => Gender => Case => Str} ; + Ord = {s : AForm => Str} ; CN = {s : Adjf => Number => Case => Str ; g : Gender} ; N = {s : Number => Case => Str ; g : Gender} ; @@ -54,11 +54,11 @@ concrete CatGer of Cat = open ResGer, Prelude in { RP = {s : GenNum => Case => Str ; a : RAgr} ; --- Numeral = {s : CardOrd => Str ; n : Number} ; + Numeral = {s : CardOrd => Str ; n : Number} ; CAdv = {s : Str} ; --- Conj = {s : Str ; n : Number} ; --- DConj = {s1,s2 : Str ; n : Number} ; --- + Conj = {s : Str ; n : Number} ; + DConj = {s1,s2 : Str ; n : Number} ; + } diff --git a/lib/resource-1.0/german/ConjunctionGer.gf b/lib/resource-1.0/german/ConjunctionGer.gf index 37a978ea4..c4ccec76a 100644 --- a/lib/resource-1.0/german/ConjunctionGer.gf +++ b/lib/resource-1.0/german/ConjunctionGer.gf @@ -1,45 +1,45 @@ concrete ConjunctionGer of Conjunction = CatGer ** open ResGer, Coordination, Prelude in { --- --- flags optimize=all_subs ; --- --- lin --- --- ConjS = conjunctSS ; --- DConjS = conjunctDistrSS ; --- --- ConjAdv = conjunctSS ; --- DConjAdv = conjunctDistrSS ; --- --- ConjNP conj ss = conjunctTable Case conj ss ** { --- a = {n = conjNumber conj.n ss.a.n ; p = ss.a.p} --- } ; --- DConjNP conj ss = conjunctDistrTable Case conj ss ** { --- a = {n = conjNumber conj.n ss.a.n ; p = ss.a.p} --- } ; --- --- ConjAP conj ss = conjunctTable Agr conj ss ** { --- isPre = ss.isPre --- } ; --- DConjAP conj ss = conjunctDistrTable Agr conj ss ** { --- isPre = ss.isPre --- } ; --- ----- These fun's are generated from the list cat's. --- --- BaseS = twoSS ; --- ConsS = consrSS comma ; --- BaseAdv = twoSS ; --- ConsAdv = consrSS comma ; --- BaseNP x y = twoTable Case x y ** {a = conjAgr x.a y.a} ; --- ConsNP xs x = consrTable Case comma xs x ** {a = conjAgr xs.a x.a} ; --- BaseAP x y = twoTable Agr x y ** {isPre = andB x.isPre y.isPre} ; --- ConsAP xs x = consrTable Agr comma xs x ** {isPre = andB xs.isPre x.isPre} ; --- --- lincat --- [S] = {s1,s2 : Str} ; --- [Adv] = {s1,s2 : Str} ; --- [NP] = {s1,s2 : Case => Str ; a : Agr} ; --- [AP] = {s1,s2 : Agr => Str ; isPre : Bool} ; --- + + flags optimize=all_subs ; + + lin + + ConjS conj ss = conjunctTable Order conj ss ; + DConjS conj ss = conjunctDistrTable Order conj ss ; + + ConjAdv conj ss = conjunctSS conj ss ; + DConjAdv conj ss = conjunctDistrSS conj ss ; + + ConjNP conj ss = conjunctTable Case conj ss ** { + a = {n = conjNumber conj.n ss.a.n ; p = ss.a.p} + } ; + DConjNP conj ss = conjunctDistrTable Case conj ss ** { + a = {n = conjNumber conj.n ss.a.n ; p = ss.a.p} + } ; + + ConjAP conj ss = conjunctTable AForm conj ss ** { + isPre = ss.isPre + } ; + DConjAP conj ss = conjunctDistrTable AForm conj ss ** { + isPre = ss.isPre + } ; + +-- These fun's are generated from the list cat's. + + BaseS = twoTable Order ; + ConsS = consrTable Order comma ; + BaseAdv = twoSS ; + ConsAdv = consrSS comma ; + BaseNP x y = twoTable Case x y ** {a = conjAgr x.a y.a} ; + ConsNP xs x = consrTable Case comma xs x ** {a = conjAgr xs.a x.a} ; + BaseAP x y = twoTable AForm x y ** {isPre = andB x.isPre y.isPre} ; + ConsAP xs x = consrTable AForm comma xs x ** {isPre = andB xs.isPre x.isPre} ; + + lincat + [S] = {s1,s2 : Order => Str} ; + [Adv] = {s1,s2 : Str} ; + [NP] = {s1,s2 : Case => Str ; a : Agr} ; + [AP] = {s1,s2 : AForm => Str ; isPre : Bool} ; + } diff --git a/lib/resource-1.0/german/LexGer.gf b/lib/resource-1.0/german/LexGer.gf index d428fa98f..84388c533 100644 --- a/lib/resource-1.0/german/LexGer.gf +++ b/lib/resource-1.0/german/LexGer.gf @@ -45,13 +45,19 @@ concrete LexGer of Lex = CatGer ** open ResGer, Prelude in { whichPl_IDet = {s = appAdj (regA "welch") ! Sg ; n = Pl} ; -- one_Numeral = {s = table {NCard => "one" ; NOrd => "first"} ; n = Sg} ; --- forty_Numeral = {s = table {NCard => "forty" ; NOrd => "fortieth"} ; n = Pl} ; + forty_Numeral = { + s = table { + NCard => "vierzig" ; + NOrd af => (regA "vierzigt").s ! Posit ! af + } ; + n = Pl + } ; in_Prep = {s = "in" ; c = Dat} ; of_Prep = {s = "von" ; c = Dat} ; --- and_Conj = {s = "and" ; n = Pl} ; --- either7or_DConj = {s1 = "either" ; s2 = "or" ; n = Sg} ; + and_Conj = {s = "und" ; n = Pl} ; + either7or_DConj = {s1 = "entweder" ; s2 = "oder" ; n = Sg} ; if_Subj = ss "wenn" ; because_Subj = ss "weil" ; diff --git a/lib/resource-1.0/german/NounGer.gf b/lib/resource-1.0/german/NounGer.gf index 500906652..9bfbc47b9 100644 --- a/lib/resource-1.0/german/NounGer.gf +++ b/lib/resource-1.0/german/NounGer.gf @@ -4,16 +4,10 @@ concrete NounGer of Noun = CatGer ** open ResGer, Prelude in { lin DetCN det cn = { - s = \\c => det.s ! cn.g ! c ++ cn.s ! adjfCase c ! det.n ! c ; + s = \\c => det.s ! cn.g ! c ++ cn.s ! adjfCase det.a c ! det.n ! c ; a = agrP3 det.n ; isPron = False - } - where { - adjfCase : Case -> Adjf = \c -> case of { - => Strong ; - _ => Weak - } - } ; + } ; UsePN pn = pn ** {a = agrP3 Sg} ; UsePron pron = { @@ -27,7 +21,7 @@ concrete NounGer of Noun = CatGer ** open ResGer, Prelude in { a = quant.a in { s = \\g,c => pred.s ! n ! g ! c ++ quant.s ! g ! c ++ - num.s ! g ! c ++ ord.s ! a ! g ! c ; + num.s ! g ! c ++ ord.s ! agrAdj g (adjfCase a c) n c ; n = n ; a = a } ; @@ -46,17 +40,16 @@ concrete NounGer of Noun = CatGer ** open ResGer, Prelude in { NoPredet = {s = \\_,_,_ => []} ; NoNum = {s = \\_,_ => []} ; - NoOrd = {s = \\_,_,_ => []} ; + NoOrd = {s = \\_ => []} ; NumInt n = {s = \\_,_ => n.s} ; --- --- NumNumeral numeral = {s = numeral.s ! NCard} ; --- OrdNumeral numeral = {s = numeral.s ! NOrd} ; --- --- AdNum adn num = {s = adn.s ++ num.s} ; --- --- OrdSuperl a = {s = a.s ! AAdj Superl} ; + NumNumeral numeral = {s = \\_,_ => numeral.s ! NCard} ; + OrdNumeral numeral = {s = \\af => numeral.s ! NOrd af} ; + + AdNum adn num = {s = \\g,c => adn.s ++ num.s ! g ! c} ; + + OrdSuperl a = {s = a.s ! Superl} ; DefSg = { s = \\g,c => artDef ! GSg g ! c ; diff --git a/lib/resource-1.0/german/ParamGer.gf b/lib/resource-1.0/german/ParamGer.gf index 12db93a66..e2126c1da 100644 --- a/lib/resource-1.0/german/ParamGer.gf +++ b/lib/resource-1.0/german/ParamGer.gf @@ -68,10 +68,10 @@ resource ParamGer = ParamX ** { RAgr = RNoAg | RAg {n : Number ; p : Person} ; -----2 For $Numeral$ --- --- CardOrd = NCard | NOrd ; --- DForm = unit | teen | ten ; +--2 For $Numeral$ + + CardOrd = NCard | NOrd AForm ; + DForm = unit | teen | ten ; --2 Transformations between parameter types @@ -96,6 +96,13 @@ resource ParamGer = ParamX ** { agrAdj : Gender -> Adjf -> Number -> Case -> AForm = \g,a,n,c -> AMod a (gennum g n) c ; +-- This is used twice in NounGer. + + adjfCase : Adjf -> Case -> Adjf = \a,c -> case of { + => Strong ; + _ => Weak + } ; + vFin : Tense -> Agr -> VForm = \t,a -> case t of { Pres => VPresInd a.n a.p ; @@ -103,9 +110,9 @@ resource ParamGer = ParamX ** { _ => VInf --- never used } ; --- conjAgr : Agr -> Agr -> Agr = \a,b -> { --- n = conjNumber a.n b.n ; --- p = conjPerson a.p b.p --- } ; --- + conjAgr : Agr -> Agr -> Agr = \a,b -> { + n = conjNumber a.n b.n ; + p = conjPerson a.p b.p + } ; + } diff --git a/lib/resource-1.0/german/QuestionGer.gf b/lib/resource-1.0/german/QuestionGer.gf index 24a017839..1405a3718 100644 --- a/lib/resource-1.0/german/QuestionGer.gf +++ b/lib/resource-1.0/german/QuestionGer.gf @@ -61,7 +61,8 @@ concrete QuestionGer of Question = CatGer ** open ResGer in { n = idet.n in { s = \\c => - idet.s ! g ! c ++ num.s ! g ! c ++ ord.s ! Weak ! g ! c ++ cn.s ! Weak ! n ! c ; + idet.s ! g ! c ++ num.s ! g ! c ++ ord.s ! agrAdj g Weak n c ++ + cn.s ! Weak ! n ! c ; n = n } ; diff --git a/lib/resource-1.0/german/log.txt b/lib/resource-1.0/german/log.txt index 8f06c11e8..fe5a80fa5 100644 --- a/lib/resource-1.0/german/log.txt +++ b/lib/resource-1.0/german/log.txt @@ -117,5 +117,23 @@ NounGer: RelCN > p -cat=RCl -mcfg "der geht" | l -table > p -cat=NP -mcfg "der Hund dem wir helfen wollen" | l -table +NounGer: Num and Ord related rules +CatGer: Ord has parametric AForm; Num has no params +ParamGer: CardOrd +LexGer: Numeral +> p -cat=NP "meine vierzig warmen Hünde" +> p -cat=NP "mein vierzigter Hund" +CatGer: Conj, DConj +ConjunctionGer: all (mostly from Scand) +LexGer: Conj, DConj +> p -cat=NP "ich und der Hund" | l -table +> p -cat=S -mcfg "ich und der Hund sind entweder warm oder warm" +> pm -printer=missing +TestGer + AdVVP AdvSC ComplV2A ComplVA EmbedQS EmbedS EmbedVP PassV2 ReflA2 ReflV2 UttVP + one_Numeral + +wc german/*.gfc + 1231 4116 98878 total \ No newline at end of file