From 869e0563d1548b3e0a4f77445e14b873ea4b6cdb Mon Sep 17 00:00:00 2001 From: aarne Date: Wed, 4 Jun 2008 12:09:14 +0000 Subject: [PATCH] completed German in 1.4 --- lib/resource-1.4/german/CatGer.gf | 5 +- lib/resource-1.4/german/NounGer.gf | 116 +++++++++++++++------ lib/resource-1.4/german/QuestionGer.gf | 30 ++++-- lib/resource-1.4/german/ResGer.gf | 2 +- lib/resource-1.4/german/SentenceGer.gf | 16 ++- lib/resource-1.4/german/VerbGer.gf | 54 ++++++---- lib/resource-1.4/scandinavian/NounScand.gf | 4 +- 7 files changed, 158 insertions(+), 69 deletions(-) diff --git a/lib/resource-1.4/german/CatGer.gf b/lib/resource-1.4/german/CatGer.gf index e34fad606..b373df421 100644 --- a/lib/resource-1.4/german/CatGer.gf +++ b/lib/resource-1.4/german/CatGer.gf @@ -28,6 +28,7 @@ concrete CatGer of Cat = IP = {s : Case => Str ; n : Number} ; IComp = {s : Agr => Str} ; IDet = {s : Gender => Case => Str ; n : Number} ; + IQuant = {s : Number => Gender => Case => Str} ; -- Relative @@ -37,6 +38,7 @@ concrete CatGer of Cat = -- Verb VP = ResGer.VP ; + VPSlash = ResGer.VP ** {c2 : Preposition} ; Comp = {s : Agr => Str} ; -- Adjective @@ -53,7 +55,8 @@ concrete CatGer of Cat = Quant = {s : Number => Gender => Case => Str ; a : Adjf} ; Art = {s : Bool => Number => Gender => Case => Str ; a : Adjf} ; Predet = {s : Number => Gender => Case => Str} ; - Num = {s : Str; n : Number } ; + Num = {s : Str ; n : Number ; isNum : Bool} ; + Card = {s : Str ; n : Number} ; Ord = {s : AForm => Str} ; -- Numeral diff --git a/lib/resource-1.4/german/NounGer.gf b/lib/resource-1.4/german/NounGer.gf index abc3ed06c..f6921f8ba 100644 --- a/lib/resource-1.4/german/NounGer.gf +++ b/lib/resource-1.4/german/NounGer.gf @@ -9,6 +9,12 @@ concrete NounGer of Noun = CatGer ** open ResGer, Prelude in { isPron = False } ; + DetNP det = { + s = \\c => det.s ! Neutr ! c ; ---- genders + a = agrP3 det.n ; + isPron = False + } ; + UsePN pn = pn ** {a = agrP3 Sg} ; UsePron pron = { @@ -31,18 +37,7 @@ concrete NounGer of Noun = CatGer ** open ResGer, Prelude in { a = np.a } ; -{- ---b - DetSg quant ord = - let - n = Sg ; - a = quant.a - in { - s = \\g,c => quant.s ! n ! g ! c ++ - ord.s ! agrAdj g (adjfCase a c) n c ; - n = n ; - a = a - } ; - DetPl quant num ord = + DetQuantOrd quant num ord = let n = num.n ; a = quant.a @@ -52,24 +47,60 @@ concrete NounGer of Noun = CatGer ** open ResGer, Prelude in { n = n ; a = a } ; --} + + DetQuant quant num = + let + n = num.n ; + a = quant.a + in { + s = \\g,c => quant.s ! n ! g ! c ++ num.s ; + n = n ; + a = a + } ; + + DetArtOrd quant num ord = + let + n = num.n ; + a = quant.a + in { + s = \\g,c => quant.s ! num.isNum ! n ! g ! c ++ + num.s ++ ord.s ! agrAdj g (adjfCase a c) n c ; + n = n ; + a = a + } ; + + DetArtCard quant num = + let + n = num.n ; + a = quant.a + in { + s = \\g,c => quant.s ! True ! n ! g ! c ++ + num.s ; + n = n ; + a = a + } ; + + DetArtPl det cn = { + s = \\c => det.s ! False ! Pl ! cn.g ! c ++ cn.s ! adjfCase det.a c ! Pl ! c ; + a = agrP3 Pl ; + isPron = False + } ; + + DetArtSg det cn = { + s = \\c => det.s ! False ! Sg ! cn.g ! c ++ cn.s ! adjfCase det.a c ! Sg ! c ; + a = agrP3 Sg ; + isPron = False + } ; PossPron p = { s = \\n,g,c => p.s ! NPPoss (gennum g n) c ; a = Strong --- need separately weak for Pl ? } ; ----b NoNum = {s = []; n = Pl } ; ----b NoOrd = {s = \\_ => []} ; + NumCard n = n ** {isNum = True} ; -{- ---b - NumInt n = {s = n.s; n = table (Predef.Ints 1 * Predef.Ints 9) { - <0,1> => Sg ; - _ => Pl - } ! <1,2> ---- parser bug (AR 2/6/2007) - } ; - OrdInt n = {s = \\_ => n.s ++ "."} ; --} + NumPl = {s = []; n = Pl ; isNum = False} ; + NumSg = {s = []; n = Sg ; isNum = False} ; NumDigits numeral = {s = numeral.s ! NCard; n = numeral.n } ; OrdDigits numeral = {s = \\af => numeral.s ! NOrd af} ; @@ -87,18 +118,22 @@ concrete NounGer of Noun = CatGer ** open ResGer, Prelude in { } ; IndefArt = { - s = \\_ => table { - Sg => \\g,c => "ein" + pronEnding ! GSg g ! c ; - Pl => \\_,_ => [] + s = table { + True => \\_,_,_ => [] ; + False => table { + Sg => \\g,c => "ein" + pronEnding ! GSg g ! c ; + Pl => \\_,_ => [] + } } ; a = Strong } ; -{- ---b - MassDet = { - s = \\_,g,c => [] ; - a = Strong + + MassNP cn = { + s = \\c => cn.s ! adjfCase Strong c ! Sg ! c ; + a = agrP3 Sg ; + isPron = False } ; --} + UseN, UseN2 = \n -> { s = \\_ => n.s ; g = n.g @@ -108,12 +143,25 @@ concrete NounGer of Noun = CatGer ** open ResGer, Prelude in { s = \\_,n,c => f.s ! n ! c ++ appPrep f.c2 x.s ; g = f.g } ; + ComplN3 f x = { s = \\n,c => f.s ! n ! c ++ appPrep f.c2 x.s ; g = f.g ; c2 = f.c3 } ; + Use2N3 f = { + s = f.s ; + g = f.g ; + c2 = f.c2 + } ; + + Use3N3 f = { + s = f.s ; + g = f.g ; + c2 = f.c3 + } ; + AdjCN ap cn = let g = cn.g @@ -130,6 +178,12 @@ concrete NounGer of Noun = CatGer ** open ResGer, Prelude in { g = cn.g } ; + RelNP np rs = { + s = \\c => np.s ! c ++ rs.s ! gennum np.a.g np.a.n ; + a = np.a ; + isPron = False + } ; + SentCN cn s = { s = \\a,n,c => cn.s ! a ! n ! c ++ s.s ; g = cn.g diff --git a/lib/resource-1.4/german/QuestionGer.gf b/lib/resource-1.4/german/QuestionGer.gf index b189a84b1..d52960680 100644 --- a/lib/resource-1.4/german/QuestionGer.gf +++ b/lib/resource-1.4/german/QuestionGer.gf @@ -66,20 +66,36 @@ concrete QuestionGer of Question = CatGer ** open ResGer in { s = \\c => ip.s ! c ++ adv.s ; n = ip.n } ; - -{- ---b - IDetCN idet num ord cn = + + IdetCN idet cn = let g = cn.g ; n = idet.n in { - s = \\c => - idet.s ! g ! c ++ num.s ++ ord.s ! agrAdj g Weak n c ++ - cn.s ! Weak ! n ! c ; + s = \\c => idet.s ! g ! c ++ cn.s ! Weak ! n ! c ; n = n } ; --} + + IdetIP idet = + let + g = Neutr ; ---- + n = idet.n + in { + s = idet.s ! g ; + n = n + } ; + + IdetQuant idet num = + let + n = num.n + in { + s = \\g,c => idet.s ! n ! g ! c ++ num.s ; + n = n + } ; + CompIAdv a = {s = \\_ => a.s} ; + CompIP ip = {s = \\_ => ip.s ! Nom} ; + } diff --git a/lib/resource-1.4/german/ResGer.gf b/lib/resource-1.4/german/ResGer.gf index 58fc7cec5..059e150b8 100644 --- a/lib/resource-1.4/german/ResGer.gf +++ b/lib/resource-1.4/german/ResGer.gf @@ -507,7 +507,7 @@ resource ResGer = ParamX ** open Prelude in { insertAdV : Str -> VP -> VP = \adv,vp -> { s = vp.s ; - a1 = \\a => vp.a1 ! a ++ adv ; + a1 = \\a => adv ++ vp.a1 ! a ; -- immer nicht n2 = vp.n2 ; a2 = vp.a2 ; isAux = vp.isAux ; diff --git a/lib/resource-1.4/german/SentenceGer.gf b/lib/resource-1.4/german/SentenceGer.gf index 4d2d6cc7f..512db531f 100644 --- a/lib/resource-1.4/german/SentenceGer.gf +++ b/lib/resource-1.4/german/SentenceGer.gf @@ -22,16 +22,12 @@ concrete SentenceGer of Sentence = CatGer ** open ResGer, Prelude in { verb.fin ++ ps.p2 ++ vp.n2 ! agr ++ vp.a1 ! pol ++ vp.a2 ++ inf ++ vp.ext } ; -{- ---b - SlashV2 np v2 = - mkClause (np.s ! Nom) np.a (predV v2) ** {c2 = v2.c2} ; - SlashVVV2 np vv v2 = - mkClause (np.s ! Nom) np.a - (insertInf (v2.prefix ++ v2.s ! VInf (notB vv.isAux)) - (predVGen vv.isAux vv)) ** - {c2 = v2.c2} ; --} + SlashVP np vp = + mkClause + (np.s ! Nom) np.a + vp ** + {c2 = vp.c2} ; AdvSlash slash adv = { s = \\m,t,a,b,o => slash.s ! m ! t ! a ! b ! o ++ adv.s ; @@ -66,4 +62,6 @@ concrete SentenceGer of Sentence = CatGer ** open ResGer, Prelude in { AdvS a s = {s = \\o => a.s ++ s.s ! Inv} ; + RelS s r = {s = \\o => s.s ! o ++ "," ++ r.s ! gennum Neutr Sg} ; --- "welches" + } diff --git a/lib/resource-1.4/german/VerbGer.gf b/lib/resource-1.4/german/VerbGer.gf index 2d6549e0a..83b7ae9e5 100644 --- a/lib/resource-1.4/german/VerbGer.gf +++ b/lib/resource-1.4/german/VerbGer.gf @@ -20,30 +20,48 @@ concrete VerbGer of Verb = CatGer ** open Prelude, ResGer in { insertExtrapos (q.s ! QIndir) (predV v) ; ComplVA v ap = insertObj (\\ _ => ap.s ! APred) (predV v) ; -{- ---b - ComplV2 v np = - insertObj (\\_ => appPrep v.c2 np.s) (predV v) ; - ComplV3 v np np2 = - insertObj (\\_ => appPrep v.c2 np.s ++ appPrep v.c3 np2.s) (predV v) ; + SlashV2a v = predV v ** {c2 = v.c2} ; + + Slash2V3 v np = + insertObj (\\_ => appPrep v.c2 np.s) (predV v) ** {c2 = v.c3} ; + Slash3V3 v np = + insertObj (\\_ => appPrep v.c3 np.s) (predV v) ** {c2 = v.c2} ; - ComplV2S v np s = - insertExtrapos (conjThat ++ s.s ! Sub) - (insertObj (\\_ => appPrep v.c2 np.s) (predV v)) ; - ComplV2Q v np q = - insertExtrapos (q.s ! QIndir) - (insertObj (\\_ => appPrep v.c2 np.s) (predV v)) ; - ComplV2V v np vp = + SlashV2S v s = + insertExtrapos (conjThat ++ s.s ! Sub) (predV v) ** {c2 = v.c2} ; + SlashV2Q v q = + insertExtrapos (q.s ! QIndir) (predV v) ** {c2 = v.c2} ; + SlashV2V v vp = + let + vpi = infVP False vp + in + insertExtrapos vpi.p3 ( + insertInf vpi.p2 ( + insertObj vpi.p1 ((predV v)))) ** {c2 = v.c2} ; + + SlashV2A v ap = + insertObj (\\_ => ap.s ! APred) (predV v) ** {c2 = v.c2} ; + + ComplSlash vp np = insertObj (\\_ => appPrep vp.c2 np.s) vp ; + + SlashVV v vp = + let + vpi = infVP v.isAux vp + in + insertExtrapos vpi.p3 ( + insertInf vpi.p2 ( + insertObj vpi.p1 ( + predVGen v.isAux v))) ** {c2 = vp.c2} ; + + SlashV2VNP v np vp = let vpi = infVP False vp in insertExtrapos vpi.p3 ( insertInf vpi.p2 ( insertObj vpi.p1 ( - (insertObj (\\_ => appPrep v.c2 np.s) (predV v))))) ; - - ComplV2A v np ap = - insertObj (\\_ => appPrep v.c2 np.s ++ ap.s ! APred) (predV v) ; --} + insertObj (\\_ => appPrep v.c2 np.s) ( + predV v)))) ** {c2 = v.c2} ; UseComp comp = insertAdv (comp.s ! agrP3 Sg) (predV sein_V) ; -- agr not used -- we want to say "ich liebe sie nicht" but not "ich bin alt nicht" @@ -55,7 +73,7 @@ concrete VerbGer of Verb = CatGer ** open Prelude, ResGer in { AdvVP vp adv = insertAdv adv.s vp ; AdVVP adv vp = insertAdV adv.s vp ; ----b ReflV2 v = insertObj (\\a => appPrep v.c2 (reflPron ! a)) (predV v) ; + ReflVP vp = insertObj (\\a => appPrep vp.c2 (reflPron ! a)) vp ; PassV2 v = insertInf (v.s ! VPastPart APred) (predV werdenPass) ; diff --git a/lib/resource-1.4/scandinavian/NounScand.gf b/lib/resource-1.4/scandinavian/NounScand.gf index 1460df711..3279e694a 100644 --- a/lib/resource-1.4/scandinavian/NounScand.gf +++ b/lib/resource-1.4/scandinavian/NounScand.gf @@ -164,14 +164,14 @@ incomplete concrete NounScand of Noun = } ; Use2N3 f = { - s = \\n,d,c => f.s ! n ! d ! Nom ; + s = f.s ; g = f.g ; c2 = f.c2 ; isMod = False } ; Use3N3 f = { - s = \\n,d,c => f.s ! n ! d ! Nom ; + s = f.s ; g = f.g ; c2 = f.c3 ; isMod = False