diff --git a/lib/resource-1.0/german/AdjectiveGer.gf b/lib/resource-1.0/german/AdjectiveGer.gf index b035fb0ba..53fe467ab 100644 --- a/lib/resource-1.0/german/AdjectiveGer.gf +++ b/lib/resource-1.0/german/AdjectiveGer.gf @@ -1,5 +1,7 @@ concrete AdjectiveGer of Adjective = CatGer ** open ResGer, Prelude in { + flags optimize=all_subs ; + lin PositA a = { @@ -8,35 +10,35 @@ concrete AdjectiveGer of Adjective = CatGer ** open ResGer, Prelude in { } ; ComparA a np = { s = \\af => a.s ! Compar ! af ++ "als" ++ np.s ! Nom ; - isPre = False + isPre = True + } ; + +-- $SuperlA$ belongs to determiner syntax in $Noun$. + + ComplA2 a np = { + s = \\af => a.s ! Posit ! af ++ appPrep a.c2 np.s ; + isPre = True } ; ----- $SuperlA$ belongs to determiner syntax in $Noun$. --- --- ComplA2 a np = { --- s = \\_ => a.s ! AAdj Posit ++ a.c2 ++ np.s ! Acc ; --- isPre = False --- } ; --- -- ReflA2 a = { -- s = \\ag => a.s ! AAdj Posit ++ a.c2 ++ reflPron ! ag ; -- isPre = False -- } ; --- --- SentAP ap s = { --- s = \\a => ap.s ! a ++ conjThat ++ s.s ; --- isPre = False --- } ; --- QuestAP ap qs = { --- s = \\a => ap.s ! a ++ qs.s ! QIndir ; --- isPre = False --- } ; + + SentAP ap s = { + s = \\a => ap.s ! a ++ conjThat ++ s.s ! Sub ; + isPre = False + } ; + QuestAP ap qs = { + s = \\a => ap.s ! a ++ qs.s ! QIndir ; + isPre = False + } ; AdAP ada ap = { s = \\a => ada.s ++ ap.s ! a ; isPre = ap.isPre } ; --- --- UseA2 a = a ; --- + + UseA2 a = a ; + } diff --git a/lib/resource-1.0/german/AdverbGer.gf b/lib/resource-1.0/german/AdverbGer.gf index 00d06bb4f..3b8c11f31 100644 --- a/lib/resource-1.0/german/AdverbGer.gf +++ b/lib/resource-1.0/german/AdverbGer.gf @@ -1,21 +1,22 @@ concrete AdverbGer of Adverb = CatGer ** open ResGer, Prelude in { --- --- lin --- PositAdvAdj a = {s = a.s ! AAdv} ; --- ComparAdvAdj cadv a np = { --- s = cadv.s ++ a.s ! AAdv ++ "than" ++ np.s ! Nom --- } ; --- ComparAdvAdjS cadv a s = { --- s = cadv.s ++ a.s ! AAdv ++ "than" ++ s.s --- } ; --- --- PrepNP prep np = {s = prep.s ++ np.s ! Acc} ; --- --- AdAdv = cc2 ; --- --- SubjS = cc2 ; + + lin + PositAdvAdj a = {s = a.s ! Posit ! APred} ; + + ComparAdvAdj cadv a np = { + s = cadv.s ++ a.s ! Posit ! APred ++ conjThan ++ np.s ! Nom + } ; + ComparAdvAdjS cadv a s = { + s = cadv.s ++ a.s ! Posit ! APred ++ conjThan ++ s.s ! Sub + } ; + + PrepNP prep np = {s = appPrep prep np.s} ; + + AdAdv = cc2 ; + + SubjS subj s = {s = subj.s ++ s.s ! Sub} ; -- AdvSC s = s ; --- this rule give stack overflow in ordinary parsing --- --- AdnCAdv cadv = {s = cadv.s ++ "than"} ; --- + + AdnCAdv cadv = {s = cadv.s ++ conjThan} ; + } diff --git a/lib/resource-1.0/german/CatGer.gf b/lib/resource-1.0/german/CatGer.gf index cab2a2652..0fc6fdfa1 100644 --- a/lib/resource-1.0/german/CatGer.gf +++ b/lib/resource-1.0/german/CatGer.gf @@ -3,19 +3,19 @@ concrete CatGer of Cat = open ResGer, Prelude in { flags optimize=all_subs ; lincat --- Text, Phr, Utt = {s : Str} ; --- --- Imp = {s : Polarity => Number => Str} ; + Text, Phr, Utt = {s : Str} ; + + Imp = {s : Polarity => Number => Str} ; S = {s : Order => Str} ; --- QS = {s : QForm => Str} ; + QS = {s : QForm => Str} ; -- RS = {s : Agr => Str} ; Cl = {s : Tense => Anteriority => Polarity => Order => Str} ; -- Slash = {s : Tense => Anteriority => Polarity => Order => Str} ** {c2 : Str} ; -- --- QCl = {s : Tense => Anteriority => Polarity => QForm => Str} ; --- RCl = {s : Tense => Anteriority => Polarity => Agr => Str} ; + QCl = {s : Tense => Anteriority => Polarity => QForm => Str} ; + RCl = {s : Tense => Anteriority => Polarity => Agr => Str} ; VP = ResGer.VP ; V, VS, VQ, VA = ResGer.Verb ; -- = {s : VForm => Str} ; @@ -25,9 +25,9 @@ concrete CatGer of Cat = open ResGer, Prelude in { AP = {s : AForm => Str ; isPre : Bool} ; Comp = {s : Agr => Str} ; --- --- SC = {s : Str} ; --- + + SC = {s : Str} ; + A = {s : Degree => AForm => Str} ; A2 = {s : Degree => AForm => Str ; c2 : Preposition} ; @@ -47,16 +47,16 @@ concrete CatGer of Cat = open ResGer, Prelude in { N2 = {s : Number => Case => Str ; g : Gender} ** {c2 : Preposition} ; N3 = {s : Number => Case => Str ; g : Gender} ** {c2,c3 : Preposition} ; --- IP = {s : Case => Str ; n : Number} ; --- IDet = {s : Str ; n : Number} ; --- IAdv = {s : Str} ; --- + IP = {s : Case => Str ; n : Number} ; + IDet = {s : Gender => Case => Str ; n : Number} ; + IAdv = {s : Str} ; + -- RP = {s : Case => Str ; a : RAgr} ; -- -- Numeral = {s : CardOrd => Str ; n : Number} ; --- --- CAdv = {s : Str} ; --- + + CAdv = {s : Str} ; + -- Conj = {s : Str ; n : Number} ; -- DConj = {s1,s2 : Str ; n : Number} ; -- diff --git a/lib/resource-1.0/german/PhraseGer.gf b/lib/resource-1.0/german/PhraseGer.gf index a50b3a967..d7a126a16 100644 --- a/lib/resource-1.0/german/PhraseGer.gf +++ b/lib/resource-1.0/german/PhraseGer.gf @@ -1,23 +1,25 @@ concrete PhraseGer of Phrase = CatGer, TenseX ** open ResGer in { --- --- lin --- PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ; --- --- UttS s = s ; --- UttQS qs = {s = qs.s ! QDir} ; --- UttImpSg pol imp = {s = pol.s ++ imp.s ! pol.p ! Sg} ; --- UttImpPl pol imp = {s = pol.s ++ imp.s ! pol.p ! Pl} ; --- --- UttIP ip = {s = ip.s ! Nom} ; --- Acc also --- UttIAdv iadv = iadv ; --- UttNP np = {s = np.s ! Acc} ; --- UttVP vp = {s = "to" ++ infVP vp (agrP3 Sg)} ; --- UttAdv adv = adv ; --- --- NoPConj = {s = []} ; --- PConjConj conj = conj ; --- --- NoVoc = {s = []} ; --- VocNP np = {s = "," ++ np.s ! Nom} ; --- + + flags optimize=all_subs ; + + lin + PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ; + + UttS s = {s = s.s ! Main} ; + UttQS qs = {s = qs.s ! QDir} ; + UttImpSg pol imp = {s = pol.s ++ imp.s ! pol.p ! Sg} ; + UttImpPl pol imp = {s = pol.s ++ imp.s ! pol.p ! Pl} ; + + UttIP ip = {s = ip.s ! Nom} ; --- Acc also + UttIAdv iadv = iadv ; + UttNP np = {s = np.s ! Acc} ; +---- UttVP vp = {s = infMark ++ infVP vp (agrP3 Sg)} ; + UttAdv adv = adv ; + + NoPConj = {s = []} ; + PConjConj conj = conj ; + + NoVoc = {s = []} ; + VocNP np = {s = "," ++ np.s ! Nom} ; + } diff --git a/lib/resource-1.0/german/ResGer.gf b/lib/resource-1.0/german/ResGer.gf index 76ca127fa..fa6b9197b 100644 --- a/lib/resource-1.0/german/ResGer.gf +++ b/lib/resource-1.0/german/ResGer.gf @@ -173,6 +173,11 @@ resource ResGer = ParamGer ** open Prelude in { appPrep : Preposition -> (Case => Str) -> Str = \prep,arg -> prep.s ++ arg ! prep.c ; +-- To build a preposition from just a case. + + noPreposition : Case -> Preposition = \c -> + {s = [] ; c = c} ; + -- Pronouns and articles -- Here we define personal and relative pronouns. -- All personal pronouns, except "ihr", conform to the simple @@ -410,23 +415,6 @@ resource ResGer = ParamGer ** open Prelude in { ext = vp.ext ++ ext } ; - s = \\a => table { - VPFinite t Anter => case t of { - Pres | Past => vf (hat t a) vpart ; - Fut => vf (wird a) (vpart ++ haben) ; - Cond => vf (wuerde a) (vpart ++ haben) - } ; - VPImperat => vf (verb.s ! VImper a.n) [] ; - VPInfinit Simul => vf [] vinf ; - VPInfinit Anter => vf [] (vpart ++ haben) - } ; - a1 : Polarity => Str = negation ; - n2 : Agr => Str = \\_ => [] ; - a2 : Str = [] ; - ext : Str = [] - } ; - - -- For $Sentence$. @@ -452,6 +440,8 @@ resource ResGer = ParamGer ** open Prelude in { conjThat : Str = "daß" ; + conjThan : Str = "als" ; + reflPron : Agr => Str = table { {n = Sg ; p = P1} => "mich" ; {n = Sg ; p = P2} => "dich" ; diff --git a/lib/resource-1.0/german/SentenceGer.gf b/lib/resource-1.0/german/SentenceGer.gf index 79cd47574..4b9811150 100644 --- a/lib/resource-1.0/german/SentenceGer.gf +++ b/lib/resource-1.0/german/SentenceGer.gf @@ -6,21 +6,17 @@ concrete SentenceGer of Sentence = CatGer ** open ResGer in { PredVP np vp = mkClause (np.s ! Nom) np.a vp ; --- PredSCVP sc vp = mkClause sc.s (agrP3 Sg) vp ; --- --- ImpVP vp = { --- s = \\pol,n => --- let --- agr = {n = n ; p = P2} ; --- verb = infVP vp agr ; --- dont = case pol of { --- Neg => "don't" ; --- _ => [] --- } --- in --- dont ++ verb --- } ; --- + PredSCVP sc vp = mkClause sc.s (agrP3 Sg) vp ; + + ImpVP vp = { + s = \\pol,n => + let + agr = {n = n ; p = P2} ; + verb = vp.s ! agr ! VPImperat ; + in + verb.fin ++ vp.a1 ! pol ++ verb.inf ++ vp.n2 ! agr ++ vp.a2 ++ vp.ext + } ; + -- SlashV2 np v2 = -- mkClause (np.s ! Nom) np.a (predV v2) ** {c2 = v2.c2} ; -- diff --git a/lib/resource-1.0/german/VerbGer.gf b/lib/resource-1.0/german/VerbGer.gf index 5cc4cd2c7..c3002e54f 100644 --- a/lib/resource-1.0/german/VerbGer.gf +++ b/lib/resource-1.0/german/VerbGer.gf @@ -27,14 +27,14 @@ concrete VerbGer of Verb = CatGer ** open ResGer in { CompNP np = {s = \\_ => np.s ! Nom} ; CompAdv a = {s = \\_ => a.s} ; --- AdvVP vp adv = insertObj (\\_ => adv.s) vp ; ------- AdVVP adv vp = insertAdV adv.s vp ; + AdvVP vp adv = insertAdv adv.s vp ; +-- AdVVP adv vp = insertAdV adv.s vp ; -- -- ReflV2 v = insertObj (\\a => v.c2 ++ reflPron ! a) (predV v) ; -- -- PassV2 v = {s = \\_ => v.s ! VPPart} ; --- --- UseVV, UseVS, UseVQ = \vv -> {s = vv.s ; c2 = []} ; -- no "to" + + UseVV, UseVS, UseVQ = \v -> v ** {c2 = noPreposition Acc} ; -- EmbedS s = {s = conjThat ++ s.s} ; -- EmbedQS qs = {s = qs.s ! QIndir} ; diff --git a/lib/resource-1.0/german/log.txt b/lib/resource-1.0/german/log.txt index e16b42923..9828a1c11 100644 --- a/lib/resource-1.0/german/log.txt +++ b/lib/resource-1.0/german/log.txt @@ -27,7 +27,7 @@ LexGer: Pron, Det AdjectiveGer: PositA, ComparA, AdAP > p -cat=NP "ein warmer Hund" | l -table -> p -cat=NP -lexer=literals "alle meine 3 sehr warmen Hünde" +> p -cat=NP -lexer=literals "alle meine 3 sehr warmen Hünde" ResGer: predV, mkClause, aux verbs VerbGer: UseV @@ -65,7 +65,7 @@ VerbGer: UseComp, Comp* ResGer: wollen_V, auxVV, insertExtrapos VerbGer: ComplVS -> p -cat=Cl -mcfg "ich behaupte daß wir gehen" | l -table +> p -cat=Cl -mcfg "ich behaupte daß wir gehen" | l -table (gets OK with proper extrapos) VerbGer: ComplVV = insertObj (\\a => v.part ++ (vp.s ! a ! VPInfinit Simul).inf) (predV v) ; @@ -74,3 +74,12 @@ VerbGer: ComplVV Pres Anter Pos Inv : habe ich gehen gewollen Pres Anter Pos Sub : ich gehen gewollen habe (Thus "double infinitives" don't get right.) + + +Added routine stuff to AdverbGer and AdjectiveGer. Noticed failure with +comparison ("schneller als ein Zug" pro "mehr schnell als ein Zug") + +SentenceGer: ImpVP +PhraseGer: almost all (actually copied from PhraseScand) +> p -cat=Imp -mcfg "geh hier" +ImpVP (AdvVP (UseV walk_V) here_Adv)