From c3e4a8b454c5845e621ab50a52a7082ebf21ef6c Mon Sep 17 00:00:00 2001 From: krasimir Date: Tue, 5 Feb 2008 15:54:58 +0000 Subject: [PATCH] add bulgarian language (still incomplete) --- lib/resource/bulgarian/AdjParadigmsBul.gf | 188 ++++++ lib/resource/bulgarian/Bulgarian.gf | 6 + lib/resource/bulgarian/BulgarianAbs.gf | 6 + lib/resource/bulgarian/CatBul.gf | 56 ++ lib/resource/bulgarian/ExtraBul.gf | 6 + lib/resource/bulgarian/ExtraBulAbs.gf | 2 + lib/resource/bulgarian/GrammarBul.gf | 15 + lib/resource/bulgarian/LangBul.gf | 10 + lib/resource/bulgarian/LexiconBul.gf | 157 +++++ lib/resource/bulgarian/MorphoBul.gf | 34 ++ lib/resource/bulgarian/NounBul.gf | 52 ++ lib/resource/bulgarian/ParadigmsBul.gf | 87 +++ lib/resource/bulgarian/PhraseBul.gf | 9 + lib/resource/bulgarian/QuestionBul.gf | 39 ++ lib/resource/bulgarian/ResBul.gf | 328 +++++++++++ lib/resource/bulgarian/SentenceBul.gf | 29 + lib/resource/bulgarian/StructuralBul.gf | 161 ++++++ lib/resource/bulgarian/VerbBul.gf | 21 + lib/resource/bulgarian/VerbParadigmsBul.gf | 644 +++++++++++++++++++++ 19 files changed, 1850 insertions(+) create mode 100644 lib/resource/bulgarian/AdjParadigmsBul.gf create mode 100644 lib/resource/bulgarian/Bulgarian.gf create mode 100644 lib/resource/bulgarian/BulgarianAbs.gf create mode 100644 lib/resource/bulgarian/CatBul.gf create mode 100644 lib/resource/bulgarian/ExtraBul.gf create mode 100644 lib/resource/bulgarian/ExtraBulAbs.gf create mode 100644 lib/resource/bulgarian/GrammarBul.gf create mode 100644 lib/resource/bulgarian/LangBul.gf create mode 100644 lib/resource/bulgarian/LexiconBul.gf create mode 100644 lib/resource/bulgarian/MorphoBul.gf create mode 100644 lib/resource/bulgarian/NounBul.gf create mode 100644 lib/resource/bulgarian/ParadigmsBul.gf create mode 100644 lib/resource/bulgarian/PhraseBul.gf create mode 100644 lib/resource/bulgarian/QuestionBul.gf create mode 100644 lib/resource/bulgarian/ResBul.gf create mode 100644 lib/resource/bulgarian/SentenceBul.gf create mode 100644 lib/resource/bulgarian/StructuralBul.gf create mode 100644 lib/resource/bulgarian/VerbBul.gf create mode 100644 lib/resource/bulgarian/VerbParadigmsBul.gf diff --git a/lib/resource/bulgarian/AdjParadigmsBul.gf b/lib/resource/bulgarian/AdjParadigmsBul.gf new file mode 100644 index 000000000..830bd4c82 --- /dev/null +++ b/lib/resource/bulgarian/AdjParadigmsBul.gf @@ -0,0 +1,188 @@ +resource AdjParadigmsBul = open + (Predef=Predef), + Prelude, + MorphoBul, + CatBul + in { +oper + mkA76 : Str -> A = + \nov -> mkAdjective nov + (nov+"ия") + (nov+"ият") + (nov+"а") + (nov+"ата") + (nov+"о") + (nov+"ото") + (nov+"и") + (nov+"ите") + ** {lock_A = <>} ; + mkA77 : Str -> A = + \vish -> mkAdjective vish + (vish+"ия") + (vish+"ият") + (vish+"а") + (vish+"ата") + (vish+"е") + (vish+"ето") + (vish+"и") + (vish+"ите") + ** {lock_A = <>} ; + mkA78 : Str -> A = + \bylgarski -> + let bylgarsk = init bylgarski + in mkAdjective bylgarski + (bylgarsk+"ия") + (bylgarsk+"ият") + (bylgarsk+"а") + (bylgarsk+"ата") + (bylgarsk+"о") + (bylgarsk+"ото") + (bylgarsk+"и") + (bylgarsk+"ите") + ** {lock_A = <>} ; + mkA79 : Str -> A = + \silen -> let siln : Str = case silen of { sil+"ен" => sil+"н" } + in mkAdjective silen + (siln+"ия") + (siln+"ият") + (siln+"а") + (siln+"ата") + (siln+"о") + (siln+"ото") + (siln+"и") + (siln+"ите") + ** {lock_A = <>} ; + mkA80 : Str -> A = + \dobyr -> let dobr : Str = case dobyr of { dob+"ъ"+r@("ш"|"р"|"л"|"к"|"г"|"в") => dob+r } + in mkAdjective dobyr + (dobr+"ия") + (dobr+"ият") + (dobr+"а") + (dobr+"ата") + (dobr+"о") + (dobr+"ото") + (dobr+"и") + (dobr+"ите") + ** {lock_A = <>} ; + mkA81 : Str -> A = + \bial -> let bel : Str = ia2e bial + in mkAdjective bial + (bel+"ия") + (bel+"ият") + (bial+"а") + (bial+"ата") + (bial+"о") + (bial+"ото") + (bel+"и") + (bel+"ите") + ** {lock_A = <>} ; + mkA82 : Str -> A = + \ostrowryh -> let ostrowyrh : Str = case ostrowryh of { ostrow+"ръ"+h@("з"|"х"|"б") => ostrow+"ър"+h } + in mkAdjective ostrowryh + (ostrowyrh+"ия") + (ostrowyrh+"ият") + (ostrowyrh+"а") + (ostrowyrh+"ата") + (ostrowyrh+"о") + (ostrowyrh+"ото") + (ostrowyrh+"и") + (ostrowyrh+"ите") + ** {lock_A = <>} ; + mkA82а : Str -> A = + \dyrzyk -> let dryzk : Str = case dyrzyk of { d+"ързък" => d+"ръзк" } + in mkAdjective dyrzyk + (dryzk+"ия") + (dryzk+"ият") + (dryzk+"а") + (dryzk+"ата") + (dryzk+"о") + (dryzk+"ото") + (dryzk+"и") + (dryzk+"ите") + ** {lock_A = <>} ; + mkA83 : Str -> A = + \riadyk ->let riadk : Str = case riadyk of { riad+"ък" => riad+"к"} + in mkAdjective riadyk + (ia2e riadk+"ия") + (ia2e riadk+"ият") + (riadk+"а") + (riadk+"ата") + (riadk+"о") + (riadk+"ото") + (ia2e riadk+"и") + (ia2e riadk+"ите") + ** {lock_A = <>} ; + mkA84 : Str -> A = + \veren -> let viarn : Str = case veren of { v + "е" + r@("д"|"з"|"н"|"р"|"с"|"т")+"ен" => v+"я"+r+"н" } + in mkAdjective veren + (ia2e viarn+"ия") + (ia2e viarn+"ият") + (viarn+"а") + (viarn+"ата") + (viarn+"о") + (viarn+"ото") + (ia2e viarn+"и") + (ia2e viarn+"ите") + ** {lock_A = <>} ; + mkA84а : Str -> A = + \svesten -> + let sviastn : Str = case svesten of { sv + "естен" => sv+"ястн" } + in mkAdjective svesten + (ia2e sviastn+"ия") + (ia2e sviastn+"ият") + (sviastn+"а") + (sviastn+"ата") + (sviastn+"о") + (sviastn+"ото") + (ia2e sviastn+"и") + (ia2e sviastn+"ите") + ** {lock_A = <>} ; + mkA85 : Str -> A = + \stroen -> + let stroin : Str = case stroen of { stro + "ен" => stro+"йн" } + in mkAdjective stroen + (stroin+"ия") + (stroin+"ият") + (stroin+"а") + (stroin+"ата") + (stroin+"о") + (stroin+"ото") + (stroin+"и") + (stroin+"ите") + ** {lock_A = <>} ; + mkA86 : Str -> A = + \sin -> mkAdjective sin + (sin+"ия") + (sin+"ият") + (sin+"я") + (sin+"ята") + (sin+"ьо") + (sin+"ьото") + (sin+"и") + (sin+"ите") + ** {lock_A = <>} ; + mkA87 : Str -> A = + \ovchi -> let ovch : Str = case ovchi of { ovch+"и" => ovch } + in mkAdjective ovchi + (ovch+"ия") + (ovch+"ият") + (ovch+"а") + (ovch+"ата") + (ovch+"е") + (ovch+"ето") + (ovch+"и") + (ovch+"ите") + ** {lock_A = <>} ; + mkA88 : Str -> A = + \kozi -> let koz : Str = case kozi of { koz+"и" => koz } + in mkAdjective kozi + (koz+"ия") + (koz+"ият") + (koz+"я") + (koz+"ята") + (koz+"е") + (koz+"ето") + (koz+"и") + (koz+"ите") + ** {lock_A = <>} ; +} \ No newline at end of file diff --git a/lib/resource/bulgarian/Bulgarian.gf b/lib/resource/bulgarian/Bulgarian.gf new file mode 100644 index 000000000..7fa27a6dd --- /dev/null +++ b/lib/resource/bulgarian/Bulgarian.gf @@ -0,0 +1,6 @@ +--# -path=.:../abstract:../common:prelude + +concrete Bulgarian of BulgarianAbs = + LangBul, + ExtraBul + ** {} ; diff --git a/lib/resource/bulgarian/BulgarianAbs.gf b/lib/resource/bulgarian/BulgarianAbs.gf new file mode 100644 index 000000000..c14c7b0d6 --- /dev/null +++ b/lib/resource/bulgarian/BulgarianAbs.gf @@ -0,0 +1,6 @@ +--# -path=.:../abstract:../common:prelude + +abstract BulgarianAbs = + Lang, + ExtraBulAbs + ** {} ; diff --git a/lib/resource/bulgarian/CatBul.gf b/lib/resource/bulgarian/CatBul.gf new file mode 100644 index 000000000..6a3c51216 --- /dev/null +++ b/lib/resource/bulgarian/CatBul.gf @@ -0,0 +1,56 @@ +concrete CatBul of Cat = CommonX ** open ResBul, Prelude in { + + flags optimize=all_subs ; + + lincat + +-- Tensed/Untensed + + S = {s : Str} ; + QS = {s : QForm => Str} ; + +-- Sentence + + Cl = {s : ResBul.Tense => Anteriority => Polarity => Order => Str} ; + Imp = {s : Polarity => ImpForm => Str} ; + +-- Question + + QCl = {s : ResBul.Tense => Anteriority => Polarity => QForm => Str} ; + IP = {s : Str ; gn : GenNum} ; + IComp = {s : Str} ; + IDet = {s : Gender => Str ; n : Number; det : Dt} ; + +-- Verb + + VP = { + s : ResBul.Tense => Anteriority => Polarity => Agr => Str ; + imp : Polarity => Number => Str ; + s2 : Agr => Str + } ; + + Comp = {s : Agr => Str} ; + +-- Noun + + CN = {s : Number => Case => Dt => Str; g : Gender} ; + NP, Pron = {s : Case => Str ; a : Agr} ; + Det = {s : Gender => Str ; n : Number; det : Dt} ; + Num = {s : Str; n : Number } ; + Quant = {s : AForm => Str; det : Dt} ; + +-- Structural + + Subj = {s : Str} ; + Prep = {s : Str} ; + +-- Open lexical classes, e.g. Lexicon + + V, VS, VQ, VA = Verb ; + V2, V2A = Verb ** {c2 : Str} ; + V3 = Verb ** {c2, c3 : Str} ; + + A = {s : AForm => Str} ; + + N = {s : AForm => Str; g : Gender} ; +} \ No newline at end of file diff --git a/lib/resource/bulgarian/ExtraBul.gf b/lib/resource/bulgarian/ExtraBul.gf new file mode 100644 index 000000000..00af7d211 --- /dev/null +++ b/lib/resource/bulgarian/ExtraBul.gf @@ -0,0 +1,6 @@ +concrete ExtraBul of ExtraBulAbs = CatBul ** + open ResBul, Coordination, Prelude in { + + lin + GenNP np = {s = \\aform => np.s ! Gen aform} ; +} diff --git a/lib/resource/bulgarian/ExtraBulAbs.gf b/lib/resource/bulgarian/ExtraBulAbs.gf new file mode 100644 index 000000000..223a25ea8 --- /dev/null +++ b/lib/resource/bulgarian/ExtraBulAbs.gf @@ -0,0 +1,2 @@ +abstract ExtraBulAbs = Extra ** { +} diff --git a/lib/resource/bulgarian/GrammarBul.gf b/lib/resource/bulgarian/GrammarBul.gf new file mode 100644 index 000000000..d3245aea6 --- /dev/null +++ b/lib/resource/bulgarian/GrammarBul.gf @@ -0,0 +1,15 @@ +--# -path=.:../abstract:../common:prelude + +concrete GrammarBul of Grammar = + NounBul, + VerbBul, + SentenceBul, + QuestionBul, + PhraseBul, + TextX, + StructuralBul + ** { + +flags startcat = Phr ; unlexer = text ; lexer = text ; + +} ; diff --git a/lib/resource/bulgarian/LangBul.gf b/lib/resource/bulgarian/LangBul.gf new file mode 100644 index 000000000..5941644e1 --- /dev/null +++ b/lib/resource/bulgarian/LangBul.gf @@ -0,0 +1,10 @@ +--# -path=.:../abstract:../common:prelude + +concrete LangBul of Lang = + GrammarBul, + LexiconBul + ** { + +flags startcat = Phr ; unlexer = text ; lexer = text ; + +} ; diff --git a/lib/resource/bulgarian/LexiconBul.gf b/lib/resource/bulgarian/LexiconBul.gf new file mode 100644 index 000000000..b9fed0d0d --- /dev/null +++ b/lib/resource/bulgarian/LexiconBul.gf @@ -0,0 +1,157 @@ +--# -path=.:prelude + +concrete LexiconBul of Lexicon = CatBul ** + open ParadigmsBul, Prelude in { + +flags + optimize=values ; + +lin + bad_A = mkA76 "лош" ; + beautiful_A = mkA76 "красив" ; + big_A = mkA81 "голям" ; + black_A = mkA79 "черен" ; + blue_A = mkA86 "син" ; + break_V2 = dirV2 (mkV173 "чупя") ; + brown_A = mkA76 "кафяв" ; + buy_V2 = dirV2 (mkV173 "купя") ; + clean_A = mkA76 "чист" ; + clever_A = mkA79 "умен" ; + close_V2 = dirV2 (mkV173 "затворя") ; + cold_A = mkA76 "студен" ; + come_V = mkV146a "дойда" ; + die_V = mkV150a "умра" ; + dirty_A = mkA79 "мръсен" ; + drink_V2 = dirV2 (mkV163 "пия") ; + eat_V2 = dirV2 (mkV169 "ям") ; + empty_A = mkA79 "празен" ; + find_V2 = dirV2 (mkV173 "намеря") ; + forget_V2 = dirV2 (mkV173 "забравя") ; + good_A = mkA80 "добър" ; + go_V = mkV186 "отивам" ; + green_A = mkA76 "зелен" ; + hate_V2 = dirV2 (mkV173 "мразя") ; + have_V2 = dirV2 (mkV186 "имам") ; + hear_V2 = dirV2 (mkV186 "чувам") ; + hot_A = mkA76 "горещ" ; + important_A = mkA79 "важен" ; + know_V2 = dirV2 (mkV162 "зная") ; + learn_V2 = dirV2 (mkV176 "уча") ; + leave_V2 = dirV2 (mkV173 "оставя") ; + like_V2 = dirV2 (mkV186 "харесвам") ; + listen_V2 = dirV2 (mkV186 "слушам") ; + live_V = mkV160 "живея" ; + long_A = mkA80 "дълъг" ; + lose_V2 = dirV2 (mkV173 "губя") ; + love_V2 = dirV2 (mkV186 "обичам") ; +-- married_A2 = mkA2 (mkA76 "женен") toP ; + narrow_A = mkA84 "тесен" ; + new_A = mkA76 "нов" ; + old_A = mkA76 "стар" ; + open_V2 = dirV2 (mkV187 "отварям") ; + play_V2 = dirV2 (mkV161 "играя") ; + read_V2 = dirV2 (mkV145 "чета") ; + red_A = mkA76 "червен" ; + run_V = (mkV186 "бягам") ; + seek_V2 = dirV2 (mkV173 "търся") ; + see_V2 = dirV2 (mkV186 "виждам") ; + sell_V3 = dirV3 (mkV186 "продавам") naP ; + send_V3 = dirV3 (mkV186 "пращам") doP ; + short_A = mkA76 "къс" ; + sleep_V = mkV182 "спя" ; + small_A = mkA80 "малък" ; + speak_V2 = dirV2 (mkV173 "говоря") ; + stupid_A = mkA76 "глупав" ; + switch8off_V2 = dirV2 (mkV186 "изключвам") ; + switch8on_V2 = dirV2 (mkV186 "включвам") ; + teach_V2 = dirV2 (mkV186 "преподавам") ; + thick_A = mkA76 "дебел" ; + thin_A = mkA80 "тънък" ; + travel_V = mkV186 "пътувам" ; + ugly_A = mkA76 "глупав" ; + understand_V2 = dirV2 (mkV186 "разбирам") ; + wait_V2 = prepV2 (mkV186 "чакам") zaP ; + walk_V = mkV173 "ходя" ; + warm_A = mkA80 "топъл" ; + watch_V2 = dirV2 (mkV186 "гледам") ; + white_A = mkA81 "бял" ; + win_V2 = dirV2 (mkV174 "победя") ; + + write_V2 = dirV2 (mkV159 "пиша") ; + yellow_A = mkA76 "жълт" ; + young_A = mkA76 "млад" ; +-- do_V2 = dirV2 (mk5V "do" "does" "did" "done" "doing") ; + now_Adv = mkAdv "сега" ; + already_Adv = mkAdv "вече" ; +-- put_V2 = prepV2 (irregDuplV "put" "put" "put") noPrep ; + stop_V = mkV150 "спра" ; + jump_V = mkV176 "скоча" ; + far_Adv = mkAdv "далече" ; + correct_A = mkA79 "правилен" ; + dry_A = mkA76 "сух" ; +-- dull_A = regA "dull" ; + full_A = mkA79 "пълен" ; + heavy_A = mkA80 "тежък" ; + near_A = mkA80 "близък" ; +-- rotten_A = (regA "rotten") ; + round_A = mkA80 "кръгъл" ; + sharp_A = mkA80 "остър" ; +-- smooth_A = regA "smooth" ; +-- straight_A = regA "straight" ; + wet_A = mkA80 "мокър" ; ---- + wide_A = mkA76 "широк" ; +-- blow_V = IrregEng.blow_V ; +-- breathe_V = dirV2 (regV "breathe") ; + burn_V = mkV187 "изгарям" ; +-- dig_V = IrregEng.dig_V ; +-- fall_V = IrregEng.fall_V ; + float_V = mkV186 "плавам" ; + flow_V = mkV148 "тека" ; + fly_V = mkV177 "летя" ; + freeze_V = mkV186 "замръзвам" ; + laugh_V = mkV160 "смея" ; + lie_V = mkV178 "лежа" ; + play_V = mkV161 "играя" ; +-- sew_V = IrregEng.sew_V ; + sing_V = mkV164 "пея" ; +-- sit_V = IrregEng.sit_V ; + smell_V = mkV159 "мириша" ; + spit_V = mkV163 "плюя" ; +-- stand_V = IrregEng.stand_V ; +-- swell_V = IrregEng.swell_V ; + swim_V = mkV186 "плувам" ; + think_V = mkV173 "мисля" ; + turn_V = mkV186 "обръщам" ; +-- vomit_V = regV "vomit" ; + +-- bite_V2 = dirV2 IrregEng.bite_V ; + count_V2 = dirV2 (mkV175 "броя") ; + cut_V2 = dirV2 (mkV157 "режа") ; + fear_V2 = dirV2 (mkV186 "страхувам") ; + fight_V2 = dirV2 (mkV173 "боря") ; +-- hit_V2 = dirV2 hit_V ; +-- hold_V2 = dirV2 hold_V ; + hunt_V2 = dirV2 (mkV174 "ловя") ; + kill_V2 = dirV2 (mkV163 "убия") ; +-- pull_V2 = dirV2 (regV "pull") ; +-- push_V2 = dirV2 (regV "push") ; +-- rub_V2 = dirV2 (regDuplV "rub") ; +-- scratch_V2 = dirV2 (regV "scratch") ; + split_V2 = dirV2 (mkV174 "разделя") ; +-- squeeze_V2 = dirV2 (regV "squeeze") ; +-- stab_V2 = dirV2 (regDuplV "stab") ; +-- suck_V2 = dirV2 (regV "suck") ; + throw_V2 = dirV2 (mkV173 "хвърля") ; +-- tie_V2 = dirV2 (regV "tie") ; + wash_V2 = dirV2 (mkV163 "мия") ; +-- wipe_V2 = dirV2 (regV "wipe") ; + + ready_A = mkA76 "готов" ; + today_Adv = mkAdv "днес" ; + uncertain_A = mkA79 "неясен" ; + +oper + zaP = mkPrep "за" ; + naP = mkPrep "на" ; + doP = mkPrep "до" ; +} ; diff --git a/lib/resource/bulgarian/MorphoBul.gf b/lib/resource/bulgarian/MorphoBul.gf new file mode 100644 index 000000000..b63458e4a --- /dev/null +++ b/lib/resource/bulgarian/MorphoBul.gf @@ -0,0 +1,34 @@ +--# -path=.:../../prelude + +--1 A Simple English Resource Morphology +-- +-- Aarne Ranta 2002 -- 2005 +-- +-- This resource morphology contains definitions needed in the resource +-- syntax. To build a lexicon, it is better to use $ParadigmsEng$, which +-- gives a higher-level access to this module. + +resource MorphoBul = ResBul ** open Prelude, (Predef=Predef) in { + + flags optimize=all ; + +oper +--2 Determiners + + mkDeterminerSg : Str -> Str -> Str -> {s : Gender => Str; n : Number; det : Dt} = \vseki,vsiaka,vsiako -> + {s = table Gender [vseki;vsiaka;vsiako]; n = Sg; det = NDet} ; + mkDeterminerPl : Str -> {s : Gender => Str ; n : Number; det : Dt} = \vsicki -> + {s = \\_ => vsicki; n = Sg; det = NDet} ; + + mkQuant : Str -> Str -> Str -> Str -> {s : AForm => Str; det : Dt} = \tozi,tazi,towa,tezi -> { + s = \\gn => case gn of { + ASg Masc _ => tozi ; + ASg Fem _ => tazi ; + ASg Neut _ => towa ; + APl _ => tezi ; + AFullDet => tozi + }; + det = NDet + } ; + +} \ No newline at end of file diff --git a/lib/resource/bulgarian/NounBul.gf b/lib/resource/bulgarian/NounBul.gf new file mode 100644 index 000000000..48aa7995d --- /dev/null +++ b/lib/resource/bulgarian/NounBul.gf @@ -0,0 +1,52 @@ +concrete NounBul of Noun = CatBul ** open ResBul, Prelude in { + + flags optimize=all_subs ; + + lin + DetCN det cn = + { s = \\c => det.s ! cn.g ++ cn.s ! det.n ! c ! det.det ; + a = agrP3 (gennum cn.g det.n) + } ; + UsePron p = p ; + + DetSg quant ord = { + s = \\g => quant.s ! ASg g NDet ++ ord.s ; + n = Sg ; + det=quant.det + } ; + + DetPl quant num ord = { + s = \\g => quant.s ! aformGenNum (gennum g num.n) ++ num.s ++ ord.s ; + n = num.n ; + det=quant.det + } ; + + PossPron p = {s = \\aform => p.s ! Gen aform; det = NDet} ; + + NoNum = {s = []; n = Pl } ; + NoOrd = {s = []} ; + + DefArt = { + s = \\_ => [] ; + det = ResBul.Det + } ; + + IndefArt = { + s = \\_ => [] ; + det = ResBul.NDet + } ; + + MassDet = {s = \\_ => [] ; n = Sg ; det = NDet} ; + + UseN noun = { + s = \\n,c,dt => let aform = case n of { + Sg => case of { + => AFullDet ; + _ => ASg noun.g dt + } ; + Pl => APl dt + } + in noun.s ! aform ; + g = noun.g + } ; +} diff --git a/lib/resource/bulgarian/ParadigmsBul.gf b/lib/resource/bulgarian/ParadigmsBul.gf new file mode 100644 index 000000000..12555efd7 --- /dev/null +++ b/lib/resource/bulgarian/ParadigmsBul.gf @@ -0,0 +1,87 @@ +--# -path=.:../abstract:../../prelude:../common + +--1 Bulgarian Lexical Paradigms +-- +-- Krasimir Angelov 2008 +-- +-- This is an API for the user of the resource grammar +-- for adding lexical items. It gives functions for forming +-- expressions of open categories: nouns, adjectives, verbs. +-- +-- Closed categories (determiners, pronouns, conjunctions) are +-- accessed through the resource syntax API, $Structural.gf$. +-- +-- The main difference with $MorphoBul.gf$ is that the types +-- referred to are compiled resource grammar types. We have moreover +-- had the design principle of always having existing forms, rather +-- than stems, as string arguments of the paradigms. +-- +-- The structure of functions for each word class $C$ is the following: +-- first we give a handful of patterns that aim to cover all +-- regular cases. Then we give a worst-case function $mkC$, which serves as an +-- escape to construct the most irregular words of type $C$. + +resource ParadigmsBul = VerbParadigmsBul, AdjParadigmsBul ** open + (Predef=Predef), + Prelude, + MorphoBul, + CatBul + in { + +oper +--2 Adverbs + +-- Adverbs are not inflected. Most lexical ones have position +-- after the verb. Some can be preverbal (e.g. "always"). + + mkAdv : Str -> Adv ; + mkAdV : Str -> AdV ; + +-- Adverbs modifying adjectives and sentences can also be formed. + + mkAdA : Str -> AdA ; + +--2 Prepositions +-- +-- A preposition as used for rection in the lexicon, as well as to +-- build $PP$s in the resource API, just requires a string. + + mkPrep : Str -> Prep ; + noPrep : Prep ; + +--2 Verbs +-- + +--3 Two-place verbs +-- +-- Two-place verbs need a preposition, except the special case with direct object. +-- (transitive verbs). Notice that a particle comes from the $V$. + + mkAdv x = ss x ** {lock_Adv = <>} ; + mkAdV x = ss x ** {lock_AdV = <>} ; + mkAdA x = ss x ** {lock_AdA = <>} ; + + prepV2 : V -> Prep -> V2 ; + dirV2 : V -> V2 ; + +--3 Three-place verbs +-- +-- Three-place (ditransitive) verbs need two prepositions, of which +-- the first one or both can be absent. + + mkV3 : V -> Prep -> Prep -> V3 ; -- speak, with, about + dirV3 : V -> Prep -> V3 ; -- give,_,to + dirdirV3 : V -> V3 ; -- give,_,_ + + mkAdv x = ss x ** {lock_Adv = <>} ; + + mkPrep p = ss p ** {lock_Prep = <>} ; + noPrep = mkPrep [] ; + + prepV2 v p = v ** {s = v.s ; c2 = p.s ; lock_V2 = <>} ; + dirV2 v = prepV2 v noPrep; + + mkV3 v p q = v ** {s = v.s ; s1 = v.s1 ; c2 = p.s ; c3 = q.s ; lock_V3 = <>} ; + dirV3 v p = mkV3 v noPrep p ; + dirdirV3 v = dirV3 v noPrep ; +} \ No newline at end of file diff --git a/lib/resource/bulgarian/PhraseBul.gf b/lib/resource/bulgarian/PhraseBul.gf new file mode 100644 index 000000000..994a607ac --- /dev/null +++ b/lib/resource/bulgarian/PhraseBul.gf @@ -0,0 +1,9 @@ +concrete PhraseBul of Phrase = CatBul ** open Prelude, ResBul in { + + lin + UttS s = s ; + UttQS qs = {s = qs.s ! QDir} ; + UttImpSg pol imp = {s = pol.s ++ imp.s ! pol.p ! ImpF Sg False} ; + UttImpPl pol imp = {s = pol.s ++ imp.s ! pol.p ! ImpF Pl False} ; + UttImpPol pol imp = {s = pol.s ++ imp.s ! pol.p ! ImpF Sg True } ; +} diff --git a/lib/resource/bulgarian/QuestionBul.gf b/lib/resource/bulgarian/QuestionBul.gf new file mode 100644 index 000000000..b1298a3c8 --- /dev/null +++ b/lib/resource/bulgarian/QuestionBul.gf @@ -0,0 +1,39 @@ +concrete QuestionBul of Question = CatBul ** open ResBul, Prelude in { + + flags optimize=all_subs ; + + lin + + QuestCl cl = { + s = \\t,a,p => + let cls = cl.s ! t ! a ! p + in table { + QDir => cls ! OQuest ; + QIndir => "ако" ++ cls ! ODir + } ---- "whether" in ExtEng + } ; + + QuestVP ip vp = + let cl = mkClause ip.s {gn = ip.gn ; p = P3} vp + in {s = \\t,a,b,_ => cl.s ! t ! a ! b ! ODir} ; + + QuestIAdv iadv cl = mkQuestion iadv cl ; + + QuestIComp icomp np = + mkQuestion icomp (mkClause (np.s ! Nom) np.a (predV auxBe)) ; + + PrepIP p ip = {s = p.s ++ ip.s} ; + + AdvIP ip adv = { + s = ip.s ++ adv.s ; + gn = ip.gn + } ; + + -- IDetCN idet num ord cn = { + -- s = \\c => idet.s ++ num.s ++ ord.s ++ cn.s ! idet.n ! c ; + -- gn = idet.gn + -- } ; + + CompIAdv a = a ; + +} diff --git a/lib/resource/bulgarian/ResBul.gf b/lib/resource/bulgarian/ResBul.gf new file mode 100644 index 000000000..fcefe1f89 --- /dev/null +++ b/lib/resource/bulgarian/ResBul.gf @@ -0,0 +1,328 @@ +--# -path=.:../abstract:../common:../../prelude + +--1 Bulgarian auxiliary operations. + +-- This module contains operations that are needed to make the +-- resource syntax work. To define everything that is needed to +-- implement $Test$, it moreover contains regular lexical +-- patterns needed for $Lex$. + +resource ResBul = ParamX ** open Prelude in { + + flags optimize=all ; + +-- Some parameters, such as $Number$, are inherited from $ParamX$. + +--2 For $Noun$ + +-- This is the worst-case $Case$ needed for pronouns. + + param + Case = Nom | Acc | Gen AForm; + + GenNum = GSg Gender | GPl ; + +-- Agreement of $NP$ is a record. We'll add $Gender$ later. + + oper + Agr = {gn : GenNum ; p : Person} ; + + param + Gender = Masc | Fem | Neut ; + + Dt = NDet | Det ; + +-- The plural never makes a gender distinction. + +--2 For $Verb$ + + VForm = + VPres Number Person + | VAorist Number Person + | VImperfect Number Person + | VPerfect AForm + | VPluPerfect AForm + | VPassive AForm + | VPresPart AForm + | VImperative Number + | VGerund + ; + +-- The order of sentence is needed already in $VP$. + + Order = ODir | OQuest ; + +--2 For $Adjective$ + + AForm = + ASg Gender Dt + | APl Dt + | AFullDet + ; + +--2 Transformations between parameter types + + oper + agrP3 : GenNum -> Agr = \gn -> + {gn = gn ; p = P3} ; + + gennum : Gender -> Number -> GenNum = \g,n -> + case n of { + Sg => GSg g ; + Pl => GPl + } ; + + numGenNum : GenNum -> Number = \gn -> + case gn of { + GSg _ => Sg ; + GPl => Pl + } ; + + aformGenNum : GenNum -> AForm = \gn -> + case gn of { + GSg g => ASg g NDet ; + GPl => APl NDet + } ; + + oper +-- For $Verb$. + + Verb : Type = { + s : VForm => Str ; + } ; + + VP : Type = { + s : Tense => Anteriority => Polarity => Agr => Str ; + imp : Polarity => Number => Str ; + s2 : Agr => Str + } ; + + predV : Verb -> VP = + \verb -> + let pol : Polarity -> Str -> Str = \p,vf -> case p of { Pos => vf ; Neg => "не" ++ vf } + in { s = \\t,a,p,agr => let present = verb.s ! (VPres (numGenNum agr.gn) agr.p) ; + aorist = verb.s ! (VAorist (numGenNum agr.gn) agr.p) ; + perfect = verb.s ! (VPerfect (aformGenNum agr.gn)) ; + vf = case of { + => present ; + => auxBe.s ! (VPres (numGenNum agr.gn) agr.p) ++ perfect ; + => aorist ; + => auxBe.s ! (VAorist (numGenNum agr.gn) agr.p) ++ perfect ; + => "ще" ++ present ; + => "ще" ++ auxBe.s ! (VPres (numGenNum agr.gn) agr.p) ++ perfect ; + => auxWould.s ! (VAorist (numGenNum agr.gn) agr.p) ++ perfect ; + => auxWould.s ! (VAorist (numGenNum agr.gn) agr.p) ++ auxBe.s ! (VPerfect (aformGenNum agr.gn)) ++ perfect + } ; + in pol p vf ; + imp = \\p,n => pol p (verb.s ! VImperative n) ; + s2 = \\_ => [] + } ; + + insertObj : (Agr => Str) -> VP -> VP = \obj,vp -> { + s = vp.s ; + imp = vp.imp ; + s2 = \\a => vp.s2 ! a ++ obj ! a + } ; + + auxBe : Verb = { + s = table { + VPres Sg P1 => "съм" ; + VPres Sg P2 => "си" ; + VPres Sg P3 => "е" ; + VPres Pl P1 => "сме" ; + VPres Pl P2 => "сте" ; + VPres Pl P3 => "са" ; + VAorist Sg P1 => "бях" ; + VAorist Sg _ => "беше" ; + VAorist Pl P1 => "бяхме" ; + VAorist Pl P2 => "бяхте" ; + VAorist Pl P3 => "бяха" ; + VImperfect Sg P1 => "бях" ; + VImperfect Sg _ => "беше" ; + VImperfect Pl P1 => "бяхме" ; + VImperfect Pl P2 => "бяхте" ; + VImperfect Pl P3 => "бяха" ; + VPerfect aform => (regAdjective "бил").s ! aform ; + VPluPerfect aform => (regAdjective "бил").s ! aform ; + VPassive aform => (regAdjective "бъден").s ! aform ; + VPresPart aform => (regAdjective "бъдещ").s ! aform ; + VImperative Sg => "бъди" ; + VImperative Pl => "бъдете" ; + VGerund => "бидейки" + } + } ; + + auxWould : Verb = { + s = table { + VPres Sg P1 => "бъда" ; + VPres Sg P2 => "бъдеш" ; + VPres Sg P3 => "бъде" ; + VPres Pl P1 => "бъдем" ; + VPres Pl P2 => "бъдете" ; + VPres Pl P3 => "бъдат" ; + VAorist Sg P1 => "бих" ; + VAorist Sg _ => "би" ; + VAorist Pl P1 => "бихме" ; + VAorist Pl P2 => "бихте" ; + VAorist Pl P3 => "биха" ; + VImperfect Sg P1 => "бъдех" ; + VImperfect Sg _ => "бъдеше" ; + VImperfect Pl P1 => "бъдехме" ; + VImperfect Pl P2 => "бъдехте" ; + VImperfect Pl P3 => "бъдеха" ; + VPerfect aform => (regAdjective "бил").s ! aform ; + VPluPerfect aform => (regAdjective "бъдел").s ! aform ; + VPassive aform => (regAdjective "бъден").s ! aform ; + VPresPart aform => (regAdjective "бъдещ").s ! aform ; + VImperative Sg => "бъди" ; + VImperative Pl => "бъдете" ; + VGerund => "бъдейки" + } + } ; + + ia2e : Str -> Str = -- to be used when the next syllable has vowel different from "а","ъ","о" or "у" + \s -> case s of { + x@(_*+_) + "я" + y@(("б"|"в"|"г"|"д"|"ж"|"з"|"к"|"л"|"м"|"н"|"п"|"р"|"с"|"т"|"ф"|"х"|"ц"|"ч"|"ш"|"щ")*) + => x+"e"+y; + _ => s + }; + + mkAdjective : (_,_,_,_,_,_,_,_,_ : Str) -> {s : AForm => Str} = + \dobyr,dobria,dobriat,dobra,dobrata,dobro,dobroto,dobri,dobrite -> { + s = table { + ASg Masc NDet => dobyr ; + ASg Masc Det => dobria ; + AFullDet => dobriat ; + ASg Fem NDet => dobra ; + ASg Fem Det => dobrata ; + ASg Neut NDet => dobro ; + ASg Neut Det => dobroto ; + APl NDet => dobri ; + APl Det => dobrite + } + } ; + + regAdjective : Str -> {s : AForm => Str} = + \base -> mkAdjective base + (base+"ия") + (base+"ият") + (base+"a") + (base+"ата") + (base+"о") + (base+"ото") + (ia2e base+"и") + (ia2e base+"ите") ; + + mkVerb : (_,_,_,_,_,_,_,_,_:Str) -> Verb = + \cheta,chete,chetoh,chetqh,chel,chetql,cheten,chetqst,cheti -> { + s = table { + VPres Sg P1 => cheta; + VPres Sg P2 => chete + "ш"; + VPres Sg P3 => chete; + VPres Pl P1 => case chete of { + _ + ("а"|"я") => chete + "ме"; + _ => chete + "м" + }; + VPres Pl P2 => chete + "те"; + VPres Pl P3 => case cheta of { + vika + "м" => case chete of { + dad + "е" => dad + "ат"; + vika => vika + "т" + }; + _ => cheta + "т" + }; + VAorist Sg P1 => chetoh; + VAorist Sg _ => case chetoh of { + chet+"ох" => chete; + zova+ "х" => zova + }; + VAorist Pl P1 => chetoh + "ме"; + VAorist Pl P2 => chetoh + "те"; + VAorist Pl P3 => chetoh + "а"; + VImperfect Sg P1 => chetqh; + VImperfect Sg _ => case chete of { + rabot + "и" => rabot + "eше"; + _ => chete + "ше" + }; + VImperfect Pl P1 => chetqh + "ме"; + VImperfect Pl P2 => chetqh + "те"; + VImperfect Pl P3 => chetqh + "а"; + VPerfect aform =>let chel1 : Str = + case chel of { + pas+"ъл" => pas+"л"; + _ => chel + } + in (mkAdjective chel + (chel+"ия") + (chel+"ият") + (chel1+"a") + (chel1+"ата") + (chel1+"о") + (chel1+"ото") + (ia2e chel1+"и") + (ia2e chel1+"ите")).s ! aform ; + VPluPerfect aform => (regAdjective chetql ).s ! aform ; + VPassive aform => (regAdjective cheten ).s ! aform ; + VPresPart aform => (regAdjective chetqst).s ! aform ; + VImperative Sg => cheti; + VImperative Pl => case cheti of { + chet + "и" => chet + "ете"; + ela => ela + "те" + }; + VGerund => case chete of { + rabot + "и" => rabot + "ейки"; + _ => chete + "йки" + } + } ; + } ; + +-- For $Sentence$. + + Clause : Type = { + s : Tense => Anteriority => Polarity => Order => Str + } ; + + mkClause : Str -> Agr -> VP -> Clause = + \subj,agr,vp -> { + s = \\t,a,b,o => + let + verb = vp.s ! t ! a ! b ! agr ; + compl = vp.s2 ! agr + in case o of { + ODir => subj ++ verb ++ compl ; + OQuest => subj ++ verb ++ "ли" ++ compl + } + } ; + + mkIP : Str -> GenNum -> {s : Str ; gn : GenNum} = + \s,gn -> { + s = s ; + gn = gn + } ; + + mkNP : (az,men,moj,moia,moiat,moia_,moiata,moe,moeto,moi,moite : Str) -> GenNum -> Person -> {s : Case => Str ; a : Agr} = + \az,men,moj,moia,moiat,moia_,moiata,moe,moeto,moi,moite,gn,p -> { + s = table { + Nom => az ; + Acc => men ; + Gen aform => (mkAdjective moj moia moiat moia_ moiata moe moeto moi moite).s ! aform + } ; + a = { + gn = gn ; + p = p + } + } ; + + mkQuestion : + {s : Str} -> Clause -> + {s : Tense => Anteriority => Polarity => QForm => Str} = \wh,cl -> + { + s = \\t,a,p => + let cls = cl.s ! t ! a ! p ; + why = wh.s + in table { + QDir => why ++ cls ! OQuest ; + QIndir => why ++ cls ! ODir + } + } ; +} diff --git a/lib/resource/bulgarian/SentenceBul.gf b/lib/resource/bulgarian/SentenceBul.gf new file mode 100644 index 000000000..d50de8b49 --- /dev/null +++ b/lib/resource/bulgarian/SentenceBul.gf @@ -0,0 +1,29 @@ +concrete SentenceBul of Sentence = CatBul ** open Prelude, ResBul in { + + flags optimize=all_subs ; + + lin + PredVP np vp = mkClause (np.s ! Nom) np.a vp ; + + ImpVP vp = { + s = \\p,i => + let gn : GenNum = + case i of { + ImpF _ True => GPl ; + ImpF Sg _ => GSg (variants {Masc; Fem; Neut}) ; + ImpF Pl _ => GPl + } ; + agr = {gn = gn ; p = P2} ; + verb = vp.imp ! p ! numImp i ; + compl = vp.s2 ! agr + in + verb ++ compl + } ; + + UseCl t a p cl = { + s = t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! ODir + } ; + UseQCl t a p cl = { + s = \\q => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! q + } ; +} \ No newline at end of file diff --git a/lib/resource/bulgarian/StructuralBul.gf b/lib/resource/bulgarian/StructuralBul.gf new file mode 100644 index 000000000..119dc1495 --- /dev/null +++ b/lib/resource/bulgarian/StructuralBul.gf @@ -0,0 +1,161 @@ +concrete StructuralBul of Structural = CatBul ** + open MorphoBul, (P = ParadigmsBul), Prelude in { + + flags optimize=all ; + + lin + above_Prep = ss "над" ; + after_Prep = ss "след" ; +{- all_Predet = ss "all" ; + almost_AdA, almost_AdN = ss "almost" ; + although_Subj = ss "although" ; + always_AdV = ss "always" ; + and_Conj = ss "and" ** {n = Pl} ; +-} + because_Subj = ss "защото" ; + before_Prep = ss "преди" ; + behind_Prep = ss "зад" ; + between_Prep = ss "между" ; +{- + both7and_DConj = sd2 "both" "and" ** {n = Pl} ; + but_PConj = ss "but" ; +-} + by8agent_Prep = ss "чрез" ; + by8means_Prep = ss "чрез" ; +{- + can8know_VV, can_VV = { + s = table { + VVF VInf => ["be able to"] ; + VVF VPres => "can" ; + VVF VPPart => ["been able to"] ; + VVF VPresPart => ["being able to"] ; + VVF VPast => "could" ; --# notpresent + VVPastNeg => "couldn't" ; --# notpresent + VVPresNeg => "can't" + } ; + isAux = True + } ; +-} + during_Prep = ss ["по време на"] ; +{- + either7or_DConj = sd2 "either" "or" ** {n = Sg} ; + everybody_NP = regNP "everybody" Sg ; +-} + every_Det = mkDeterminerSg "всеки" "всяка" "всяко"; +{- + everything_NP = regNP "everything" Sg ; +-} + everywhere_Adv = ss "навсякъде" ; + few_Det = mkDeterminerPl "няколко" ; +--- first_Ord = ss "first" ; DEPRECATED + for_Prep = ss "за" ; + from_Prep = ss "от" ; + he_Pron = mkNP "той" "него" "свой" "своя" "своят" "своя" "своята" "свое" "своето" "свои" "своите" (GSg Masc) P3 ; + here_Adv = ss "тук" ; + here7to_Adv = ss ["до тук"] ; + here7from_Adv = ss ["от тук"] ; + how_IAdv = ss "как" ; + how8many_IDet = mkDeterminerPl ["колко много"] ; + if_Subj = ss "ако" ; + in8front_Prep = ss "пред" ; + i_Pron = mkNP "аз" "мен" "мой" "моя" "моят" "моя" "моята" "мое" "моето" "мои" "моите" (GSg (variants {Masc;Fem})) P1 ; + in_Prep = ss (pre { "в" ; + "във" / strs {"в" ; "ф" ; "В" ; "Ф"} + }) ; + it_Pron = mkNP "то" "него" "негов" "неговия" "неговият" "негова" "неговата" "негово" "неговото" "негови" "неговите" (GSg Neut) P3 ; + less_CAdv = ss "помалко" ; + many_Det = mkDeterminerPl "много" ; + more_CAdv = ss "повече" ; +{- + most_Predet = ss "most" ; +-} + much_Det = mkDeterminerSg "много" "много" "много"; +{- + must_VV = { + s = table { + VVF VInf => ["have to"] ; + VVF VPres => "must" ; + VVF VPPart => ["had to"] ; + VVF VPresPart => ["having to"] ; + VVF VPast => ["had to"] ; --# notpresent + VVPastNeg => ["hadn't to"] ; --# notpresent + VVPresNeg => "mustn't" + } ; + isAux = True + } ; +-} + no_Phr = ss "не" ; + on_Prep = ss "на" ; +{- +---- one_Quant = mkDeterminer Sg "one" ; -- DEPRECATED + only_Predet = ss "only" ; + or_Conj = ss "or" ** {n = Sg} ; + otherwise_PConj = ss "otherwise" ; +-} + part_Prep = ss "от" ; +{- + please_Voc = ss "please" ; +-} + possess_Prep = ss "на" ; + quite_Adv = ss "доста" ; + she_Pron = mkNP "тя" "нея" "неин" "нейния" "нейният" "нейна" "нейната" "нейно" "нейното" "нейни" "нейните" (GSg Fem) P3 ; +{- + so_AdA = ss "so" ; + somebody_NP = regNP "somebody" Sg ; + someSg_Det = mkDeterminerSg "някой" "някое" "някоя" ; + somePl_Det = mkDeterminerPl "някои" ; + something_NP = regNP "something" Sg ; +-} + somewhere_Adv = ss "някъде" ; + that_Quant = mkQuant "онзи" "онази" "онова" "онези" ; +{- + that_NP = regNP "that" Sg ; +-} + there_Adv = ss "там" ; + there7to_Adv = ss ["до там"] ; + there7from_Adv = ss ["от там"] ; +{- + therefore_PConj = ss "therefore" ; + these_NP = regNP "these" Pl ; +-} + they_Pron = mkNP "те" "тях" "техен" "техния" "техният" "тяхна" "тяхната" "тяхно" "тяхното" "техни" "техните" GPl P3 ; + this_Quant = mkQuant "този" "тaзи" "това" "тези" ; +{- + this_NP = regNP "this" Sg ; + those_NP = regNP "those" Pl ; +-} + through_Prep = ss "през" ; +{- + too_AdA = ss "too" ; +-} + to_Prep = ss "до" ; + under_Prep = ss "под" ; +{- + very_AdA = ss "very" ; + want_VV = P.mkVV (P.regV "want") ; +-} + we_Pron = mkNP "ние" "нас" "наш" "нашия" "нашият" "наша" "нашата" "наше" "нашето" "наши" "нашите" GPl P1 ; + whatPl_IP = mkIP "какви" GPl ; + whatSg_IP = variants { mkIP "какъв" (GSg Masc); mkIP "каква" (GSg Fem); mkIP "какво" (GSg Neut) } ; + when_IAdv = ss "кога" ; +{- + when_Subj = ss "when" ; +-} + where_IAdv = ss "къде" ; +{- + whichPl_IDet = mkDeterminer Pl ["which"] ; + whichSg_IDet = mkDeterminer Sg ["which"] ; +-} + whoSg_IP = variants { mkIP "кой" (GSg Masc); mkIP "коя" (GSg Fem); mkIP "кое" (GSg Neut) } ; + whoPl_IP = mkIP "кои" GPl ; + why_IAdv = ss "защо" ; + without_Prep = ss "без" ; + with_Prep = ss (pre { "с" ; + "със" / strs {"с" ; "з" ; "С" ; "З"} + }) ; + yes_Phr = ss "да" ; + youSg_Pron = mkNP "ти" "теб" "твой" "твоя" "твоят" "твоя" "твоята" "твое" "твоето" "твои" "твоите" (GSg (variants {Masc;Fem})) P2 ; + youPl_Pron = mkNP "вие" "вас" "ваш" "вашия" "вашият" "ваша" "вашата" "ваше" "вашето" "ваши" "вашите" GPl P2 ; + youPol_Pron = mkNP "вие" "вас" "ваш" "вашия" "вашият" "ваша" "вашата" "ваше" "вашето" "ваши" "вашите" (GSg (variants {Masc;Fem})) P2 ; +} + diff --git a/lib/resource/bulgarian/VerbBul.gf b/lib/resource/bulgarian/VerbBul.gf new file mode 100644 index 000000000..7534d39a9 --- /dev/null +++ b/lib/resource/bulgarian/VerbBul.gf @@ -0,0 +1,21 @@ +concrete VerbBul of Verb = CatBul ** open ResBul in { + + flags optimize=all_subs ; + + lin + UseV = predV ; + ComplV2 v np = insertObj (\\_ => v.c2 ++ np.s ! Acc) (predV v) ; + ComplV3 v np np2 = + insertObj (\\_ => v.c2 ++ np.s ! Acc ++ v.c3 ++ np2.s ! Acc) (predV v) ; + + UseComp comp = insertObj comp.s (predV auxBe) ; + + AdvVP vp adv = insertObj (\\_ => adv.s) vp ; + + ReflV2 v = insertObj (\\_ => v.c2 ++ ["себе си"]) (predV v) ; + + PassV2 v = insertObj (\\a => v.s ! VPassive (aformGenNum a.gn)) (predV auxBe) ; + + CompNP np = {s = \\_ => np.s ! Acc} ; + CompAdv a = {s = \\_ => a.s} ; +} diff --git a/lib/resource/bulgarian/VerbParadigmsBul.gf b/lib/resource/bulgarian/VerbParadigmsBul.gf new file mode 100644 index 000000000..03013880c --- /dev/null +++ b/lib/resource/bulgarian/VerbParadigmsBul.gf @@ -0,0 +1,644 @@ +resource VerbParadigmsBul = open + (Predef=Predef), + Prelude, + MorphoBul, + CatBul + in { +oper + mkV142 : Str -> V ; + mkV142 base = let stem = (init (init (init base))) + in mkVerb (stem+"съм") + (stem+"е") + (stem+"бях") + (stem+"бях") + (stem+"бил") + (stem+"бил") + (stem+"-") + (stem+"-") + (stem+"бъди") + ** {s1 = [] ; lock_V = <>} ; + mkV143 : Str -> V ; + mkV143 base = let stem = (init (init (init base))) + in mkVerb (stem+"ъда") + (stem+"ъде") + (stem+"их, идох") + (stem+"ъдех, ях") + (stem+"ил") + (stem+"ъдел") + (stem+"-") + (stem+"ъдещ") + (stem+"ъди") + ** {s1 = [] ; lock_V = <>} ; + mkV144 : Str -> V ; + mkV144 base = let stem = (init base) + in mkVerb (stem+"а") + (stem+"е") + (stem+"ях") + (stem+"ях") + (stem+"ял") + (stem+"ял") + (stem+"-") + (stem+"-") + (stem+"-") + ** {s1 = [] ; lock_V = <>} ; + mkV145 : Str -> V ; + mkV145 base = let stem = (init base) + in mkVerb (stem+"а") + (stem+"е") + (stem+"ох") + (stem+"ях") + (init stem+"л") + (stem+"ял") + (stem+"ен") + (stem+"ящ") + (stem+"и") + ** {s1 = [] ; lock_V = <>} ; + mkV145a : Str -> V ; + mkV145a base = let stem = (init (init base)) + in mkVerb (stem+"са") + (stem+"се") + (stem+"сох") + (stem+"сях") + (stem+"съл") + (stem+"сял") + (stem+"сен") + (stem+"сящ") + (stem+"си") + ** {s1 = [] ; lock_V = <>} ; + mkV145b : Str -> V ; + mkV145b base = let stem = (init (init base)) + in mkVerb (stem+"та") + (stem+"те") + (stem+"тох") + (stem+"тях") + (stem+"ъл") + (stem+"тял") + (stem+"-") + (stem+"тящ") + (stem+"ти") + ** {s1 = [] ; lock_V = <>} ; + mkV146 : Str -> V ; + mkV146 base = let stem = (init (init base)) + in mkVerb (stem+"да") + (stem+"де") + (stem+"дох") + (stem+"дех") + (stem+"шъл") + (stem+"дел") + (stem+"-") + (stem+"-") + (stem+"ди") + ** {s1 = [] ; lock_V = <>} ; + mkV146a : Str -> V ; + mkV146a base = let stem = (init (init (init base))) + in mkVerb (stem+"йда") + (stem+"йде") + (stem+"йдох") + (stem+"йдех") + (stem+"шъл") + (stem+"йдел") + (stem+"-") + (stem+"-") + (stem+"йди") + ** {s1 = [] ; lock_V = <>} ; + mkV147 : Str -> V ; + mkV147 base = let stem = (init (init (init base))) + in mkVerb (stem+"яза") + (stem+"езе") + (stem+"язох") + (stem+"езех") + (stem+"язъл") + (stem+"езел") + (stem+"-") + (stem+"-") + (stem+"ез") + ** {s1 = [] ; lock_V = <>} ; + mkV148 : Str -> V ; + mkV148 base = let stem = (init (init base)) + in mkVerb (stem+"ка") + (stem+"че") + (stem+"кох") + (stem+"чех") + (stem+"къл") + (stem+"чел") + (stem+"чен") + (stem+"чащ") + (stem+"чи") + ** {s1 = [] ; lock_V = <>} ; + mkV149 : Str -> V ; + mkV149 base = let stem = (init (init (init base))) + in mkVerb (stem+"ека") + (stem+"ече") + (stem+"якох") + (stem+"ечех") + (stem+"якъл") + (stem+"ечел") + (stem+"ечен") + (stem+"-") + (stem+"ечи") + ** {s1 = [] ; lock_V = <>} ; + mkV150 : Str -> V ; + mkV150 base = let stem = (init base) + in mkVerb (stem+"а") + (stem+"е") + (stem+"ях") + (stem+"ях") + (stem+"ял") + (stem+"ял") + (stem+"ян") + (stem+"-") + (stem+"и") + ** {s1 = [] ; lock_V = <>} ; + mkV150a : Str -> V ; + mkV150a base = let stem = (init base) + in mkVerb (stem+"а") + (stem+"е") + (stem+"ях") + (stem+"ях") + (stem+"ял") + (stem+"ял") + (stem+"-") + (stem+"-") + (stem+"и") + ** {s1 = [] ; lock_V = <>} ; + mkV151 : Str -> V ; + mkV151 base = let stem = (init base) + in mkVerb (stem+"а") + (stem+"е") + (stem+"ах") + (stem+"ях") + (stem+"ал") + (stem+"ял") + (stem+"ящ") + (stem+"ан") + (stem+"и") + ** {s1 = [] ; lock_V = <>} ; + mkV152 : Str -> V ; + mkV152 base = let stem = (init base) + in mkVerb (stem+"а") + (stem+"е") + (stem+"ах") + (stem+"ех") + (stem+"ал") + (stem+"ел") + (stem+"ат") + (stem+"-") + (stem+"и") + ** {s1 = [] ; lock_V = <>} ; + mkV152a : Str -> V ; + mkV152a base = let stem = (init (init (init (init base)))) + in mkVerb (stem+"ягна") + (stem+"егне") + (stem+"ягнах") + (stem+"ягнех") + (stem+"ягнал") + (stem+"ягнел") + (stem+"ягнат") + (stem+"-") + (stem+"егни") + ** {s1 = [] ; lock_V = <>} ; + mkV153 : Str -> V ; + mkV153 base = let stem = (init (init (init base))) + in mkVerb (stem+"яна") + (stem+"ене") + (stem+"янах") + (stem+"енех") + (stem+"янал") + (stem+"енел") + (stem+"янат") + (stem+"-") + (stem+"ени") + ** {s1 = [] ; lock_V = <>} ; + mkV154 : Str -> V ; + mkV154 base = let stem = (init base) + in mkVerb (stem+"я") + (stem+"е") + (stem+"ах") + (stem+"ех") + (stem+"ал") + (stem+"ел") + (stem+"ан") + (stem+"ещ") + (stem+"и") + ** {s1 = [] ; lock_V = <>} ; + mkV155 : Str -> V ; + mkV155 base = let stem = (init (init base)) + in mkVerb (stem+"ча") + (stem+"че") + (stem+"ках") + (stem+"чех") + (stem+"кал") + (stem+"чел") + (stem+"-") + (stem+"чещ") + (stem+"чи") + ** {s1 = [] ; lock_V = <>} ; + mkV156 : Str -> V ; + mkV156 base = let stem = (init (init base)) + in mkVerb (stem+"жа") + (stem+"же") + (stem+"зах") + (stem+"жех") + (stem+"зал") + (stem+"жел") + (stem+"зан") + (stem+"-") + (stem+"жи") + ** {s1 = [] ; lock_V = <>} ; + mkV157 : Str -> V ; + mkV157 base = let stem = (init (init (init base))) + in mkVerb (stem+"ежа") + (stem+"еже") + (stem+"язах") + (stem+"ежех") + (stem+"язал") + (stem+"ежел") + (stem+"язан") + (stem+"ежещ") + (stem+"ежи") + ** {s1 = [] ; lock_V = <>} ; + mkV158 : Str -> V ; + mkV158 base = let stem = (init (init base)) + in mkVerb (stem+"жа") + (stem+"же") + (stem+"гах") + (stem+"жех") + (stem+"гал") + (stem+"жел") + (stem+"ган") + (stem+"жещ") + (stem+"жи") + ** {s1 = [] ; lock_V = <>} ; + mkV159 : Str -> V ; + mkV159 base = let stem = (init (init base)) + in mkVerb (stem+"ша") + (stem+"ше") + (stem+"сах") + (stem+"шех") + (stem+"сал") + (stem+"шел") + (stem+"сан") + (stem+"шещ") + (stem+"ши") + ** {s1 = [] ; lock_V = <>} ; + mkV160 : Str -> V ; + mkV160 base = let stem = (init (init base)) + in mkVerb (stem+"ея") + (stem+"ее") + (stem+"ях") + (stem+"еех") + (stem+"ял") + (stem+"еел") + (stem+"ян") + (stem+"еещ") + (stem+"ей") + ** {s1 = [] ; lock_V = <>} ; + mkV160a : Str -> V ; + mkV160a base = let stem = (init (init base)) + in mkVerb (stem+"ея") + (stem+"ее") + (stem+"ах") + (stem+"еех") + (stem+"ал") + (stem+"еел") + (stem+"ан") + (stem+"еещ") + (stem+"ей") + ** {s1 = [] ; lock_V = <>} ; + mkV161 : Str -> V ; + mkV161 base = let stem = (init base) + in mkVerb (stem+"я") + (stem+"е") + (stem+"х") + (stem+"ех") + (stem+"л") + (stem+"ел") + (stem+"н") + (stem+"ещ") + (stem+"й") + ** {s1 = [] ; lock_V = <>} ; + mkV161a : Str -> V ; + mkV161a base = let stem = (init base) + in mkVerb (stem+"я") + (stem+"е") + (stem+"х") + (stem+"ех") + (stem+"л") + (stem+"ел") + (stem+"т") + (stem+"ещ") + (stem+"й") + ** {s1 = [] ; lock_V = <>} ; + mkV162 : Str -> V ; + mkV162 base = let stem = (init base) + in mkVerb (stem+"я") + (stem+"е") + (stem+"ях") + (stem+"ех") + (stem+"ял") + (stem+"ел") + (stem+"-") + (stem+"ещ") + (stem+"й") + ** {s1 = [] ; lock_V = <>} ; + mkV163 : Str -> V ; + mkV163 base = let stem = (init base) + in mkVerb (stem+"я") + (stem+"е") + (stem+"х") + (stem+"ех") + (stem+"л") + (stem+"ел") + (stem+"т") + (stem+"ещ") + (stem+"й") + ** {s1 = [] ; lock_V = <>} ; + mkV164 : Str -> V ; + mkV164 base = let stem = (init (init base)) + in mkVerb (stem+"ея") + (stem+"ее") + (stem+"ях") + (stem+"еех") + (stem+"ял") + (stem+"еел") + (stem+"ят") + (stem+"еещ") + (stem+"ей") + ** {s1 = [] ; lock_V = <>} ; + mkV165 : Str -> V ; + mkV165 base = let stem = (init base) + in mkVerb (stem+"а") + (stem+"е") + (stem+"ех") + (stem+"ех") + (stem+"ел") + (stem+"ел") + (stem+"ел") + (stem+"ещ") + (stem+"и") + ** {s1 = [] ; lock_V = <>} ; + mkV166 : Str -> V ; + mkV166 base = let stem = (init (init base)) + in mkVerb (stem+"га") + (stem+"же") + (stem+"жах") + (stem+"жех") + (stem+"гъл") + (stem+"жел") + (stem+"-") + (stem+"жещ") + (stem+"-") + ** {s1 = [] ; lock_V = <>} ; + mkV167 : Str -> V ; + mkV167 base = let stem = (init (init base)) + in mkVerb (stem+"ка") + (stem+"че") + (stem+"ках") + (stem+"чех") + (stem+"кал") + (stem+"чел") + (stem+"кан") + (stem+"чещ") + (stem+"чи") + ** {s1 = [] ; lock_V = <>} ; + mkV168 : Str -> V ; + mkV168 base = let stem = (init base) + in mkVerb (stem+"м") + (stem+"де") + (stem+"дох") + (stem+"дях") + (stem+"л") + (stem+"дял") + (stem+"ден") + (stem+"-") + (stem+"й") + ** {s1 = [] ; lock_V = <>} ; + mkV169 : Str -> V ; + mkV169 base = let stem = (init base) + in mkVerb (stem+"м") + (stem+"де") + (stem+"дох") + (stem+"дях") + (stem+"л") + (stem+"дял") + (stem+"ден") + (stem+"дещ") + (stem+"ж") + ** {s1 = [] ; lock_V = <>} ; + mkV170 : Str -> V ; + mkV170 base = let stem = (init (init (init base))) + in mkVerb (stem+"ера") + (stem+"ере") + (stem+"рах") + (stem+"ерях") + (stem+"рал") + (stem+"ерял") + (stem+"ран") + (stem+"ерящ") + (stem+"ери") + ** {s1 = [] ; lock_V = <>} ; + mkV171 : Str -> V ; + mkV171 base = let stem = (init (init base)) + in mkVerb (stem+"ма") + (stem+"ме") + (stem+"х") + (stem+"мех") + (stem+"л") + (stem+"мел") + (stem+"т") + (stem+"-") + (stem+"ми") + ** {s1 = [] ; lock_V = <>} ; + mkV172 : Str -> V ; + mkV172 base = let stem = (init (init (init (init base)))) + in mkVerb (stem+"ълна") + (stem+"ълне") + (stem+"лех") + (stem+"ълнех") + (stem+"лел") + (stem+"ълнел") + (stem+"ълнат") + (stem+"ълнещ") + (stem+"ълни") + ** {s1 = [] ; lock_V = <>} ; + mkV173 : Str -> V ; + mkV173 base = let stem = (init base) + in mkVerb (stem+"я") + (stem+"и") + (stem+"их") + (stem+"ех") + (stem+"ил") + (stem+"ел") + (stem+"ен") + (stem+"ещ") + (stem+"и") + ** {s1 = [] ; lock_V = <>} ; + mkV174 : Str -> V ; + mkV174 base = let stem = (init base) + in mkVerb (stem+"я") + (stem+"и") + (stem+"их") + (stem+"ях") + (stem+"ил") + (stem+"ял") + (stem+"ен") + (stem+"ящ") + (stem+"и") + ** {s1 = [] ; lock_V = <>} ; + mkV175 : Str -> V ; + mkV175 base = let stem = (init base) + in mkVerb (stem+"я") + (stem+"и") + (stem+"их") + (stem+"ях") + (stem+"ил") + (stem+"ял") + (stem+"ен") + (stem+"ящ") + (stem+"й") + ** {s1 = [] ; lock_V = <>} ; + mkV176 : Str -> V ; + mkV176 base = let stem = (init base) + in mkVerb (stem+"а") + (stem+"и") + (stem+"их") + (stem+"ех") + (stem+"ил") + (stem+"ел") + (stem+"ен") + (stem+"ещ") + (stem+"и") + ** {s1 = [] ; lock_V = <>} ; + mkV177 : Str -> V ; + mkV177 base = let stem = (init base) + in mkVerb (stem+"я") + (stem+"и") + (stem+"ях") + (stem+"ях") + (stem+"ял") + (stem+"ял") + (stem+"ян") + (stem+"ящ") + (stem+"и") + ** {s1 = [] ; lock_V = <>} ; + mkV178 : Str -> V ; + mkV178 base = let stem = (init base) + in mkVerb (stem+"а") + (stem+"и") + (stem+"ах") + (stem+"ех") + (stem+"ал") + (stem+"ел") + (stem+"-") + (stem+"ащ") + (stem+"и") + ** {s1 = [] ; lock_V = <>} ; + mkV179 : Str -> V ; + mkV179 base = let stem = (init (init (init (init base)))) + in mkVerb (stem+"ържа") + (stem+"ържи") + (stem+"ържах") + (stem+"ържех") + (stem+"ържал") + (stem+"ържел") + (stem+"ържан") + (stem+"ържащ") + (stem+"ръж") + ** {s1 = [] ; lock_V = <>} ; + mkV180 : Str -> V ; + mkV180 base = let stem = (init base) + in mkVerb (stem+"я") + (stem+"и") + (stem+"ях") + (stem+"ях") + (stem+"ял") + (stem+"ял") + (stem+"-") + (stem+"ящ") + (stem+"й") + ** {s1 = [] ; lock_V = <>} ; + mkV181 : Str -> V ; + mkV181 base = let stem = (init (init base)) + in mkVerb (stem+"дя") + (stem+"ди") + (stem+"дях") + (stem+"дех") + (stem+"дял") + (stem+"дел") + (stem+"дян") + (stem+"-") + (stem+"ж") + ** {s1 = [] ; lock_V = <>} ; + mkV182 : Str -> V ; + mkV182 base = let stem = (init base) + in mkVerb (stem+"я") + (stem+"и") + (stem+"ах") + (stem+"ях") + (stem+"ал") + (stem+"ял") + (stem+"-") + (stem+"ящ") + (stem+"и") + ** {s1 = [] ; lock_V = <>} ; + mkV183 : Str -> V ; + mkV183 base = let stem = (init (init (init base))) + in mkVerb (stem+"ежа") + (stem+"ежи") + (stem+"язах") + (stem+"ежех") + (stem+"язал") + (stem+"ежел") + (stem+"язан") + (stem+"ежещ") + (stem+"ежи") + ** {s1 = [] ; lock_V = <>} ; + mkV184 : Str -> V ; + mkV184 base = let stem = (init (init (init base))) + in mkVerb (stem+"еля") + (stem+"ели") + (stem+"лях") + (stem+"елех") + (stem+"лял") + (stem+"елел") + (stem+"лян, лят") + (stem+"елещ") + (stem+"ели") + ** {s1 = [] ; lock_V = <>} ; + mkV185 : Str -> V ; + mkV185 base = let stem = (init (init (init base))) + in mkVerb (stem+"оля") + (stem+"оли") + (stem+"лах") + (stem+"олех") + (stem+"лал") + (stem+"олел") + (stem+"лан") + (stem+"олещ") + (stem+"оли") + ** {s1 = [] ; lock_V = <>} ; + mkV186 : Str -> V ; + mkV186 base = let stem = (init (init base)) + in mkVerb (stem+"ам") + (stem+"а") + (stem+"ах") + (stem+"ах") + (stem+"ал") + (stem+"ал") + (stem+"ан") + (stem+"ащ") + (stem+"ай") + ** {s1 = [] ; lock_V = <>} ; + mkV187 : Str -> V ; + mkV187 base = let stem = (init (init base)) + in mkVerb (stem+"ям") + (stem+"я") + (stem+"ях") + (stem+"ях") + (stem+"ял") + (stem+"ял") + (stem+"ян") + (stem+"ящ") + (stem+"яй") + ** {s1 = [] ; lock_V = <>} ; +} \ No newline at end of file