From cdee869595627545390f2388342677f4591afeb6 Mon Sep 17 00:00:00 2001 From: Krasimir Angelov Date: Sat, 29 Aug 2026 18:04:10 +0200 Subject: [PATCH] added all tenses + renarrative forms --- src/bulgarian/ExtendBul.gf | 4 +- src/bulgarian/ExtraBul.gf | 2 +- src/bulgarian/IdiomBul.gf | 29 ++------- src/bulgarian/ResBul.gf | 129 +++++++++++++++++++++++++++++-------- src/bulgarian/TenseBul.gf | 6 +- 5 files changed, 112 insertions(+), 58 deletions(-) diff --git a/src/bulgarian/ExtendBul.gf b/src/bulgarian/ExtendBul.gf index 2c6933d6..29279aaa 100644 --- a/src/bulgarian/ExtendBul.gf +++ b/src/bulgarian/ExtendBul.gf @@ -152,7 +152,7 @@ lin MkVPS t p vp = { s = \\a => - let verb = vpTenses vp ! t.t ! t.a ! p.p ! a ! False ! Perf ; + let verb = vpTenses vp ! t.t ! t.a ! p.p ! a ! Main ! Perf ; compl = vp.compl ! a in t.s ++ p.s ++ verb ++ compl } ; @@ -318,6 +318,6 @@ lin UseComp_estar = UseComp ; lin ProDrop pro = pro ; -lin TPastSimple = {s = []} ** {t = VPastSimple} ; --# notpresent +lin TPastSimple = {s = []} ** {t = VPastSimple Indicative} ; --# notpresent } diff --git a/src/bulgarian/ExtraBul.gf b/src/bulgarian/ExtraBul.gf index 04375e75..5f4db25b 100644 --- a/src/bulgarian/ExtraBul.gf +++ b/src/bulgarian/ExtraBul.gf @@ -67,7 +67,7 @@ concrete ExtraBul of ExtraBulAbs = CatBul ** MkVPS t p vp = { s = \\a => - let verb = vpTenses vp ! t.t ! t.a ! p.p ! a ! False ! Perf ; + let verb = vpTenses vp ! t.t ! t.a ! p.p ! a ! Main ! Perf ; compl = vp.compl ! a in t.s ++ p.s ++ verb ++ compl } ; diff --git a/src/bulgarian/IdiomBul.gf b/src/bulgarian/IdiomBul.gf index 34bd8dbb..50111174 100644 --- a/src/bulgarian/IdiomBul.gf +++ b/src/bulgarian/IdiomBul.gf @@ -26,34 +26,13 @@ concrete IdiomBul of Idiom = CatBul ** open Prelude, ParadigmsBul, ResBul in { } ; agr=agrP3 (GSg Neut); - - present = verb ! (VPres (numGenNum agr.gn) agr.p) ; - aorist = verb ! (VAorist (numGenNum agr.gn) agr.p) ; - imperfect = verb ! (VImperfect (numGenNum agr.gn) agr.p) ; - perfect = verb ! (VPerfect (aform agr.gn Indef (RObj Acc))) ; - - auxPres = auxBe ! VPres (numGenNum agr.gn) agr.p ; - auxAorist = auxBe ! VAorist (numGenNum agr.gn) agr.p ; - auxCondS = auxCond ! numGenNum agr.gn ! agr.p ; - v : {aux1:Str; aux2:Str; main:Str} - = case of { - => {aux1=[]; aux2=[]; main=present} - ; --# notpresent - => {aux1=[]; aux2=auxPres; main=perfect} ; --# notpresent - => {aux1=[]; aux2=[]; main=aorist} ; --# notpresent - => {aux1=[]; aux2=auxAorist; main=perfect} ; --# notpresent - => {aux1=[]; aux2=[]; main=imperfect} ; --# notpresent - => {aux1=[]; aux2=auxAorist; main=perfect} ; --# notpresent - => {aux1="ще"; aux2=[]; main=present} ; --# notpresent - => {aux1="ще"++auxPres; aux2=[]; main=perfect} ; --# notpresent - => {aux1=auxCondS; aux2=[]; main=perfect} --# notpresent - } ; + tenses = vpTenses (predV (singleV verb)) ! t ! a ! Pos ! agr in case o of { - Main => v.aux1 ++ v.main ++ v.aux2 ++ np.s ! RObj Acc ++ adv.s ; - Inv => np.s ! RObj Acc ++ v.aux1 ++ v.main ++ v.aux2 ++ adv.s ; - Quest => v.aux1 ++ v.main ++ "ли" ++ v.aux2 ++ np.s ! RObj Acc ++ adv.s + Main => tenses ! Inv ! Perf ++ np.s ! RObj Acc ++ adv.s ; + Inv => np.s ! RObj Acc ++ tenses ! Main ! Perf ++ adv.s ; + Quest => tenses ! Quest ! Perf ++ np.s ! RObj Acc ++ adv.s } } ; diff --git a/src/bulgarian/ResBul.gf b/src/bulgarian/ResBul.gf index 7a10e08f..559c0049 100644 --- a/src/bulgarian/ResBul.gf +++ b/src/bulgarian/ResBul.gf @@ -77,12 +77,17 @@ resource ResBul = ParamX - [Tense,Pres,Past,Fut,Cond] ** open Prelude, Predef in VVType = VVInf Aspect | VVGerund ; + Mood = + Indicative + | Renarrative ; + Tense = VPresent - | VPastSimple --# notpresent - | VPastImperfect --# notpresent - | VFut --# notpresent - | VCond --# notpresent + | VPastSimple Mood --# notpresent + | VPastImperfect Mood --# notpresent + | VPastFut --# notpresent + | VFut Mood --# notpresent + | VCond Mood --# notpresent ; -- The order of sentence is needed already in $VP$. @@ -403,6 +408,19 @@ resource ResBul = ParamX - [Tense,Pres,Past,Fut,Cond] ** open Prelude, Predef in } } ; + auxWill : Number => Person => Str = + table { + Sg => table { + P1 => "щях" ; + _ => "щеше" + } ; + Pl => table { + P1 => "щяхме" ; + P2 => "щяхте" ; + P3 => "щяха" + } + } ; + verbBe : Verb = {s=table Aspect [auxBe; auxWould] ; vtype=VNormal} ; reflClitics : Case => Str = table {Acc => "се"; Dat => "си"; WithPrep => with_Word ++ "себе си"; CPrep => "себе си"} ; @@ -519,18 +537,17 @@ resource ResBul = ParamX - [Tense,Pres,Past,Fut,Cond] ** open Prelude, Predef in _ => Pos } ; agr = personAgr gn p1 ; - verb : Bool => Str - = \\q => vpTenses vp ! t ! a ! p ! agr ! q ! Perf ; + verb : Order => Str + = \\o => vpTenses vp ! t ! a ! p ! agr ! o ! Perf ; compl = vp.compl ! agr in case o of { - Main => subj ++ verb ! False ++ compl ; - Inv => verb ! False ++ compl ++ subj ; - Quest => subj ++ verb ! True ++ compl + Inv => verb ! Inv ++ compl ++ subj ; + o => subj ++ verb ! o ++ compl } } ; - vpTenses : VP -> Tense => Anteriority => Polarity => Agr => Bool => Aspect => Str = - \verb -> \\t,a,p,agr,q0,asp => + vpTenses : VP -> Tense => Anteriority => Polarity => Agr => Order => Aspect => Str = + \verb -> \\t,a,p,agr,o,asp => let clitic = case verb.vtype of { VNormal => {s=verb.clitics; agr=agr} ; VMedial c => {s=verb.clitics++reflClitics ! c; agr=agr} ; @@ -543,11 +560,14 @@ resource ResBul = ParamX - [Tense,Pres,Past,Fut,Cond] ** open Prelude, Predef in aorist = verb.s ! asp ! (VAorist (numGenNum clitic.agr.gn) clitic.agr.p) ; imperfect = verb.s ! Imperf ! (VImperfect (numGenNum clitic.agr.gn) clitic.agr.p) ; perfect = verb.s ! asp ! (VPerfect (aform clitic.agr.gn Indef (RObj Acc))) ; + pluperfect = verb.s ! asp ! (VPluPerfect (aform clitic.agr.gn Indef (RObj Acc))) ; auxPres = auxBe ! VPres (numGenNum clitic.agr.gn) clitic.agr.p ; auxAorist = auxBe ! VAorist (numGenNum clitic.agr.gn) clitic.agr.p ; + auxPerf = auxBe ! VPerfect (aform clitic.agr.gn Indef (RObj Acc)) ; auxImperf = auxBe ! VImperfect (numGenNum clitic.agr.gn) clitic.agr.p ; auxCondS = auxCond ! numGenNum clitic.agr.gn ! clitic.agr.p ; + auxWillS = auxWill ! numGenNum clitic.agr.gn ! clitic.agr.p ; apc : Str -> Str = \s -> case of { @@ -555,22 +575,33 @@ resource ResBul = ParamX - [Tense,Pres,Past,Fut,Cond] ** open Prelude, Predef in _ => auxPres++s++clitic.s } ; - li0 = case of { => "ли"; _ => []} ; + li0 = case of { + => "ли" ; + _ => [] + } ; - q = case verb.ad.isEmpty of {True => q0; False => False} ; - li = case q of {True => "ли"; _ => []} ; + li = case of { + => "ли"; + _ => [] + } ; vf1 : Str -> {s1 : Str; s2 : Str} = \s -> case p of { - Pos => case q of {True => {s1=[]; s2="ли"++apc []}; - False => {s1=apc []; s2=[]}} ; + Pos => case of { + => {s1=[]; s2="ли"++apc []}; + => {s1=[]; s2=apc []}; + _ => {s1=apc []; s2=[]} + } ; Neg => {s1="не"++apc li; s2=[]} } ; vf2 : Str -> {s1 : Str; s2 : Str} = \s -> case p of { - Pos => case q of {True => {s1=[]; s2="ли"++s}; - False => {s1=s; s2=[]}} ; + Pos => case of { + => {s1=[]; s2="ли"++s}; + => {s1=[]; s2=s}; + _ => {s1=s; s2=[]} + } ; Neg => case verb.vtype of {VNormal => {s1="не"++s; s2=li} ; _ => {s1="не"++s++li; s2=[]}} @@ -588,18 +619,62 @@ resource ResBul = ParamX - [Tense,Pres,Past,Fut,Cond] ** open Prelude, Predef in Neg => {s1="не"++s++li++clitic.s; s2=[]} } ; + vf5 : Str -> {s1 : Str; s2 : Str} = \s -> + case p of { + Pos => {s1=auxWillS++li++"да"++s; s2=[]} ; + Neg => {s1="нямаше"++li++"да"++s; s2=[]} + } ; + + vf6 : Str -> {s1 : Str; s2 : Str} = \s -> + case p of { + Pos => let aux : Str = + case numGenNum clitic.agr.gn of { + Sg => "щял" ; + Pl => "щели" + } + in case of { + => {s1=aux++li++auxPres++"да"++s; s2=[]}; + => {s1=aux++auxPres++"да"++s; s2=[]}; + _ => {s1=auxPres++aux++li++"да"++s; s2=[]} + } ; + Neg => {s1="нямало"++li++"да"++s; s2=[]} + } ; + + vf7 : {s1 : Str; s2 : Str} = + case of { + => case of { + => {s1=[]; s2=auxPres++li++clitic.s} ; + => {s1=auxPres++li++clitic.s; s2=[]} ; + => {s1="не"++auxPres++li++clitic.s; s2=[]} + } ; + => vf4 auxPres ; + => vf2 clitic.s ; + => vf4 auxPerf ; + => case of { + => {s1=[]; s2=auxPres++li++clitic.s++auxPerf} ; + => {s1=auxPres++li++clitic.s++auxPerf; s2=[]} ; + => {s1="не"++auxPres++li++clitic.s++auxPerf; s2=[]} + } + } ; + verbs : {aux:{s1:Str; s2:Str}; main:Str} = case of { - => {aux=vf2 clitic.s; main=presentImperf} - ; --# notpresent + => {aux=vf2 clitic.s; main=presentImperf} ; --# notpresent => {aux=vf1 clitic.s; main=perfect} ; --# notpresent - => {aux=vf2 clitic.s; main=aorist} ; --# notpresent - => {aux=vf4 auxAorist; main=perfect} ; --# notpresent - => {aux=vf2 clitic.s; main=imperfect} ; --# notpresent - => {aux=vf4 auxImperf; main=perfect} ; --# notpresent - => {aux=vf3 clitic.s; main=present} ; --# notpresent - => {aux=vf3 (apc []); main=perfect} ; --# notpresent - => {aux=vf4 auxCondS; main=perfect} --# notpresent + => {aux=vf2 clitic.s; main=aorist} ; --# notpresent + => {aux=vf4 auxAorist; main=perfect} ; --# notpresent + => {aux=vf7; main=pluperfect} ; --# notpresent + => {aux=vf2 clitic.s; main=imperfect} ; --# notpresent + => {aux=vf4 auxImperf; main=perfect} ; --# notpresent + => {aux=vf7; main=perfect} ; --# notpresent + => {aux=vf5 clitic.s; main=present} ; --# notpresent + => {aux=vf5 (apc []); main=perfect} ; --# notpresent + => {aux=vf3 clitic.s; main=present} ; --# notpresent + => {aux=vf3 (apc []); main=perfect} ; --# notpresent + => {aux=vf6 clitic.s; main=present} ; --# notpresent + => {aux=vf6 (apc []); main=perfect} ; --# notpresent + => {aux=vf4 auxCondS; main=perfect} ; --# notpresent + => {aux=vf4 (auxCondS++auxPerf); main=perfect} --# notpresent } in verb.ad.s ++ li0 ++ verbs.aux.s1 ++ verbs.main ++ verbs.aux.s2 ; diff --git a/src/bulgarian/TenseBul.gf b/src/bulgarian/TenseBul.gf index 15bebd2b..593195d0 100644 --- a/src/bulgarian/TenseBul.gf +++ b/src/bulgarian/TenseBul.gf @@ -3,8 +3,8 @@ concrete TenseBul of Tense = CatBul [Tense,Temp], TenseX - [Temp,Tense,TTAnt,TPr lin TTAnt t a = {s = a.s ++ t.s ; a = a.a ; t = t.t} ; TPres = {s = []} ** {t = VPresent} ; - TPast = {s = []} ** {t = VPastImperfect} ; --# notpresent - TFut = {s = []} ** {t = VFut} ; --# notpresent - TCond = {s = []} ** {t = VCond} ; --# notpresent + TPast = {s = []} ** {t = VPastImperfect Indicative} ; --# notpresent + TFut = {s = []} ** {t = VFut Indicative} ; --# notpresent + TCond = {s = []} ** {t = VCond Indicative} ; --# notpresent }