From fcfd71009e9316e9e195e89af63982eb32fca62f Mon Sep 17 00:00:00 2001 From: krasimir Date: Wed, 27 Feb 2008 22:21:56 +0000 Subject: [PATCH] added conjugations --- lib/resource/bulgarian/CatBul.gf | 2 + lib/resource/bulgarian/ConjunctionBul.gf | 47 ++++++++++++++++++++++++ lib/resource/bulgarian/GrammarBul.gf | 1 + lib/resource/bulgarian/ResBul.gf | 11 ++++++ lib/resource/bulgarian/StructuralBul.gf | 14 ++----- 5 files changed, 65 insertions(+), 10 deletions(-) create mode 100644 lib/resource/bulgarian/ConjunctionBul.gf diff --git a/lib/resource/bulgarian/CatBul.gf b/lib/resource/bulgarian/CatBul.gf index 4a7332f59..9931f2cab 100644 --- a/lib/resource/bulgarian/CatBul.gf +++ b/lib/resource/bulgarian/CatBul.gf @@ -89,6 +89,8 @@ concrete CatBul of Cat = open ResBul, Prelude, (R = ParamX) in { -- Structural + Conj = {s : Str ; n : Number} ; + DConj = {s1,s2 : Str ; n : Number} ; Subj = {s : Str} ; Prep = {s : Str; c : Case} ; diff --git a/lib/resource/bulgarian/ConjunctionBul.gf b/lib/resource/bulgarian/ConjunctionBul.gf new file mode 100644 index 000000000..4c0b3028e --- /dev/null +++ b/lib/resource/bulgarian/ConjunctionBul.gf @@ -0,0 +1,47 @@ +concrete ConjunctionBul of Conjunction = + CatBul ** open ResBul, Coordination, Prelude in { + + flags optimize=all_subs ; + + lin + + ConjS = conjunctSS ; + DConjS = conjunctDistrSS ; + + ConjAdv = conjunctSS ; + DConjAdv = conjunctDistrSS ; + + ConjNP conj ss = conjunctTable Role conj ss ** { + a = {gn = conjGenNum (gennum DMasc conj.n) ss.a.gn; p = ss.a.p} + } ; + DConjNP conj ss = conjunctDistrTable Role conj ss ** { + a = {gn = conjGenNum (gennum DMasc conj.n) ss.a.gn; 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 = twoSS ; + ConsS = consrSS comma ; + + BaseAdv = twoSS ; + ConsAdv = consrSS comma ; + + BaseNP x y = twoTable Role x y ** {a = conjAgr x.a y.a} ; + ConsNP xs x = consrTable Role 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 : Str} ; + [Adv] = {s1,s2 : Str} ; + [NP] = {s1,s2 : Role => Str ; a : Agr} ; + [AP] = {s1,s2 : AForm => Str ; isPre : Bool} ; +} diff --git a/lib/resource/bulgarian/GrammarBul.gf b/lib/resource/bulgarian/GrammarBul.gf index ba79da33a..b7b4184f6 100644 --- a/lib/resource/bulgarian/GrammarBul.gf +++ b/lib/resource/bulgarian/GrammarBul.gf @@ -9,6 +9,7 @@ concrete GrammarBul of Grammar = SentenceBul, QuestionBul, RelativeBul, + ConjunctionBul, PhraseBul, TextBul, StructuralBul diff --git a/lib/resource/bulgarian/ResBul.gf b/lib/resource/bulgarian/ResBul.gf index ee3eaa166..24107bfe6 100644 --- a/lib/resource/bulgarian/ResBul.gf +++ b/lib/resource/bulgarian/ResBul.gf @@ -102,6 +102,17 @@ resource ResBul = ParamX ** open Prelude in { --2 Transformations between parameter types oper + conjGenNum : GenNum -> GenNum -> GenNum = \a,b -> + case of { + => GSg g ; + _ => GPl + } ; + + conjAgr : Agr -> Agr -> Agr = \a,b -> { + gn = conjGenNum a.gn b.gn ; + p = conjPerson a.p b.p + } ; + gennum : DGender -> Number -> GenNum = \g,n -> case n of { Sg => GSg (case g of { diff --git a/lib/resource/bulgarian/StructuralBul.gf b/lib/resource/bulgarian/StructuralBul.gf index cd95e7a71..f59c52bb6 100644 --- a/lib/resource/bulgarian/StructuralBul.gf +++ b/lib/resource/bulgarian/StructuralBul.gf @@ -10,15 +10,13 @@ concrete StructuralBul of Structural = CatBul ** almost_AdA, almost_AdN = ss "почти" ; although_Subj = ss ["въпреки че"] ; {- always_AdV = ss "always" ; - and_Conj = ss "and" ** {n = Pl} ; -} + and_Conj = ss "и" ** {n = Pl} ; because_Subj = ss "защото" ; before_Prep = mkPrep "преди" Acc ; behind_Prep = mkPrep "зад" Acc ; between_Prep = mkPrep "между" Acc ; -{- - both7and_DConj = sd2 "both" "and" ** {n = Pl} ; --} + both7and_DConj = sd2 "и" "и" ** {n = Pl} ; but_PConj = ss "но" ; by8agent_Prep = mkPrep "чрез" Acc ; by8means_Prep = mkPrep "чрез" Acc ; @@ -37,9 +35,7 @@ concrete StructuralBul of Structural = CatBul ** } ; -} during_Prep = mkPrep ["по време на"] Acc ; -{- - either7or_DConj = sd2 "either" "or" ** {n = Sg} ; --} + either7or_DConj = sd2 "или" "или" ** {n = Sg} ; everybody_NP = mkNP "всеки" (GSg Masc) P3 ; every_Det = mkDeterminerSg "всеки" "всяка" "всяко"; everything_NP = mkNP "всяко" (GSg Neut) P3 ; @@ -84,9 +80,7 @@ concrete StructuralBul of Structural = CatBul ** on_Prep = mkPrep "на" Acc ; ---- one_Quant = mkDeterminer Sg "one" ; -- DEPRECATED only_Predet = {s = \\_ => "само"} ; -{- - or_Conj = ss "or" ** {n = Sg} ; --} + or_Conj = ss "или" ** {n = Sg} ; otherwise_PConj = ss "иначе" ; part_Prep = mkPrep "от" Acc ; please_Voc = ss "моля" ;