diff --git a/lib/resource/bulgarian/AdverbBul.gf b/lib/resource/bulgarian/AdverbBul.gf index c03836223..932bc9efd 100644 --- a/lib/resource/bulgarian/AdverbBul.gf +++ b/lib/resource/bulgarian/AdverbBul.gf @@ -15,5 +15,5 @@ concrete AdverbBul of Adverb = CatBul ** open ResBul, Prelude in { SubjS = cc2 ; AdvSC s = s ; --- this rule give stack overflow in ordinary parsing - AdnCAdv cadv = {s = cadv.s ++ "от"} ; + AdnCAdv cadv = {s = cadv.sn ++ "от"} ; } diff --git a/lib/resource/bulgarian/CatBul.gf b/lib/resource/bulgarian/CatBul.gf index c294ad7b4..9b092afc2 100644 --- a/lib/resource/bulgarian/CatBul.gf +++ b/lib/resource/bulgarian/CatBul.gf @@ -1,13 +1,29 @@ -concrete CatBul of Cat = CommonX ** open ResBul, Prelude in { +concrete CatBul of Cat = open ResBul, Prelude, (R = ParamX) in { flags optimize=all_subs ; + lincat +-- Text, Phrase, Utterance + + Text = {s : Str} ; + Phr = {s : Str} ; + Utt = {s : Str} ; + Voc = {s : Str} ; + PConj = {s : Str} ; + +-- Tense, Anteriority, Polarity + + Tense = {s : Str ; t : R.Tense} ; + Ant = {s : Str ; a : R.Anteriority} ; + Pol = {s : Str ; p : R.Polarity} ; + -- Tensed/Untensed S = {s : Str} ; QS = {s : QForm => Str} ; + SC = {s : Str} ; -- Sentence @@ -30,11 +46,19 @@ concrete CatBul of Cat = CommonX ** open ResBul, Prelude in { } ; Comp = {s : Agr => Str} ; + AdV = {s : Str} ; --lock_AdV : {}} ; -- Adjective AP = {s : AForm => Str; isPre : Bool} ; +-- Adjective + + Adv = {s : Str} ; + CAdv = {s : Str; sn : Str} ; + IAdv = {s : Str} ; + AdA = {s : Str} ; + -- Noun CN = {s : NForm => Str; g : DGender} ; @@ -50,6 +74,7 @@ concrete CatBul of Cat = CommonX ** open ResBul, Prelude in { Numeral = {s : CardOrd => Str; n : Number} ; Digits = {s : CardOrd => Str; n : Number; tail : DTail} ; + AdN = {s : Str} ; -- Structural @@ -69,4 +94,17 @@ concrete CatBul of Cat = CommonX ** open ResBul, Prelude in { N2 = {s : NForm => Str; g : DGender} ** {c2 : Str} ; N3 = {s : NForm => Str; g : DGender} ** {c2,c3 : Str} ; PN = {s : Str; g : Gender} ; + + +-- Tense, Anteriority and Polarity functions + + lin + PPos = {s = []} ** {p = R.Pos} ; + PNeg = {s = []} ** {p = R.Neg} ; + TPres = {s = []} ** {t = R.Pres} ; + TPast = {s = []} ** {t = R.Past} ; --# notpresent + TFut = {s = []} ** {t = R.Fut} ; --# notpresent + TCond = {s = []} ** {t = R.Cond} ; --# notpresent + ASimul = {s = []} ** {a = R.Simul} ; + AAnter = {s = []} ** {a = R.Anter} ; --# notpresent } \ No newline at end of file diff --git a/lib/resource/bulgarian/GrammarBul.gf b/lib/resource/bulgarian/GrammarBul.gf index 784645378..405d7f13c 100644 --- a/lib/resource/bulgarian/GrammarBul.gf +++ b/lib/resource/bulgarian/GrammarBul.gf @@ -9,7 +9,7 @@ concrete GrammarBul of Grammar = SentenceBul, QuestionBul, PhraseBul, - TextX, + TextBul, StructuralBul ** { diff --git a/lib/resource/bulgarian/StructuralBul.gf b/lib/resource/bulgarian/StructuralBul.gf index 4f855c8ad..c58e76395 100644 --- a/lib/resource/bulgarian/StructuralBul.gf +++ b/lib/resource/bulgarian/StructuralBul.gf @@ -63,9 +63,9 @@ concrete StructuralBul of Structural = CatBul ** "във" / strs {"в" ; "ф" ; "В" ; "Ф"} }) ; it_Pron = mkNP "то" "него" "негов" "неговия" "неговият" "негова" "неговата" "негово" "неговото" "негови" "неговите" (GSg Neut) P3 ; - less_CAdv = ss "не" ; + less_CAdv = {s="не"; sn="по-малко"} ; many_Det = mkDeterminerPl "много" ; - more_CAdv = ss [] ; + more_CAdv = {s=[]; sn="повече"} ; most_Predet = {s = \\_ => "повечето"} ; much_Det = mkDeterminerSg "много" "много" "много"; {- diff --git a/lib/resource/bulgarian/TextBul.gf b/lib/resource/bulgarian/TextBul.gf new file mode 100644 index 000000000..f3aa46909 --- /dev/null +++ b/lib/resource/bulgarian/TextBul.gf @@ -0,0 +1,11 @@ +concrete TextBul of Text = CatBul ** { + +-- This will work for almost all languages except Spanish. + + lin + TEmpty = {s = []} ; + TFullStop x xs = {s = x.s ++ "." ++ xs.s} ; + TQuestMark x xs = {s = x.s ++ "?" ++ xs.s} ; + TExclMark x xs = {s = x.s ++ "!" ++ xs.s} ; + +}