From a557b49c95f07729f25adef34f79aa4b158ebdba Mon Sep 17 00:00:00 2001 From: Krasimir Angelov Date: Sat, 26 Sep 2026 16:57:54 +0200 Subject: [PATCH] bugfixes from Codex --- src/bulgarian/ConjunctionBul.gf | 4 ++-- src/bulgarian/ConstructionBul.gf | 7 +++++++ src/bulgarian/ExtendBul.gf | 17 +++++++---------- src/bulgarian/IdiomBul.gf | 2 +- src/bulgarian/NounBul.gf | 2 +- src/bulgarian/ResBul.gf | 18 ++++++++++++++---- src/bulgarian/SentenceBul.gf | 7 ++++--- src/bulgarian/VerbBul.gf | 2 +- 8 files changed, 37 insertions(+), 22 deletions(-) diff --git a/src/bulgarian/ConjunctionBul.gf b/src/bulgarian/ConjunctionBul.gf index 5b186268..98c14a9e 100644 --- a/src/bulgarian/ConjunctionBul.gf +++ b/src/bulgarian/ConjunctionBul.gf @@ -60,11 +60,11 @@ concrete ConjunctionBul of Conjunction = BaseNP x y = {s = \\role=>table {4 => y.s!role; _ => x.s!role}; gn = conjGenNum x.gn y.gn; - p = x.p} ; + p = conjPronPerson x.p y.p} ; ConsNP x xs = {s = \\role=>table {4 => xs.s!role!4; t => x.s!role++linCoord bindComma!t++xs.s!role!t}; gn = conjGenNum xs.gn x.gn; - p = x.p} ; + p = conjPronPerson x.p xs.p} ; BaseAP x y = {s = \\aform,p => table {4 => y.s!aform!p; _ => x.s!aform!p} ; diff --git a/src/bulgarian/ConstructionBul.gf b/src/bulgarian/ConstructionBul.gf index 619bc01b..bcdfe7fd 100644 --- a/src/bulgarian/ConstructionBul.gf +++ b/src/bulgarian/ConstructionBul.gf @@ -32,6 +32,13 @@ lin is_right_VP = mkVP (mkA084 "верен") ; is_wrong_VP = mkVP (mkA079 "грешен") ; n_units_AP card cn a = mkAP (lin AdA (mkUtt (mkNP (lin CN cn)))) (lin A a) ; + n_units_of_NP card cn np = + let unit = mkNP (lin CN cn) + in { + s = \\role => unit.s ! role ++ np.s ! R.RObj R.CPrep ; + gn = unit.gn ; + p = unit.p + } ; weather_adjCl a = R.mkClause (a.s ! R.ASg R.Masc R.Indef ! R.P3) (R.GSg R.Masc) (R.NounP3 R.Pos) (R.insertObj (\\_=>"") R.Pos (R.predV R.verbBe)) ; lin diff --git a/src/bulgarian/ExtendBul.gf b/src/bulgarian/ExtendBul.gf index 29279aaa..a9df9b84 100644 --- a/src/bulgarian/ExtendBul.gf +++ b/src/bulgarian/ExtendBul.gf @@ -141,24 +141,21 @@ lin insertObj (\\a => vpi.s ! a) Pos (predV vv) ; lincat - VPS = {s : Agr => Str} ; - [VPS] = {s : Agr => Ints 4 => Str} ; + VPS = {s : Agr => Order => Str} ; + [VPS] = {s : Agr => Order => Ints 4 => Str} ; lin - BaseVPS x y = {s = \\a=>table {4 => y.s!a; _ => x.s!a}} ; - ConsVPS x xs = {s = \\a=>table {4 => xs.s!a!4; t => x.s!a++linCoord bindComma!t++xs.s!a!t}}; + BaseVPS x y = {s = \\a,o=>table {4 => y.s!a!Main; _ => x.s!a!o}} ; + ConsVPS x xs = {s = \\a,o=>table {4 => xs.s!a!Main!4; t => x.s!a!o++linCoord bindComma!t++xs.s!a!Main!t}}; - PredVPS np vps = {s = np.s ! RSubj ++ vps.s ! personAgr np.gn np.p} ; + PredVPS np vps = {s = np.s ! RSubj ++ vps.s ! personAgr np.gn np.p ! Main} ; MkVPS t p vp = { - s = \\a => - let verb = vpTenses vp ! t.t ! t.a ! p.p ! a ! Main ! Perf ; - compl = vp.compl ! a - in t.s ++ p.s ++ verb ++ compl + s = \\a,o => t.s ++ p.s ++ vpTenses vp ! t.t ! t.a ! p.p ! a ! o ! Perf ++ vp.compl ! a } ; ConjVPS conj vps = { - s = \\a => linCoord []!conj.sep ++ vps.s!a!conj.sep ++ conj.s ++ vps.s!a!4 + s = \\a,o => linCoord []!conj.sep ++ vps.s!a!o!conj.sep ++ conj.s ++ vps.s!a!o!4 } ; lincat [Comp] = {s : Agr => Ints 4 => Str} ; diff --git a/src/bulgarian/IdiomBul.gf b/src/bulgarian/IdiomBul.gf index 50111174..bf2b4ea2 100644 --- a/src/bulgarian/IdiomBul.gf +++ b/src/bulgarian/IdiomBul.gf @@ -32,6 +32,7 @@ concrete IdiomBul of Idiom = CatBul ** open Prelude, ParadigmsBul, ResBul in { in case o of { Main => tenses ! Inv ! Perf ++ np.s ! RObj Acc ++ adv.s ; Inv => np.s ! RObj Acc ++ tenses ! Main ! Perf ++ adv.s ; + Wh => tenses ! Wh ! Perf ++ np.s ! RObj Acc ++ adv.s ; Quest => tenses ! Quest ! Perf ++ np.s ! RObj Acc ++ adv.s } } ; @@ -52,4 +53,3 @@ concrete IdiomBul of Idiom = CatBul ** open Prelude, ParadigmsBul, ResBul in { ImpPl1 vp = {s = "нека" ++ daComplex Simul Pos vp ! Perf ! {gn = GPl ; p = P1}} ; } - diff --git a/src/bulgarian/NounBul.gf b/src/bulgarian/NounBul.gf index 1343d8f5..b643868e 100644 --- a/src/bulgarian/NounBul.gf +++ b/src/bulgarian/NounBul.gf @@ -210,7 +210,7 @@ concrete NounBul of Noun = CatBul ** open ResBul, Prelude in { GSg Fem => AFem ; GPl => ANeut } - in det.s ! False ! g ! role ++ np.s ! (RObj Acc) ; + in det.s ! False ! g ! role ++ "от" ++ np.s ! (RObj CPrep) ; gn = gennum ANeut (numnnum det.nn); p = NounP3 Pos } ; diff --git a/src/bulgarian/ResBul.gf b/src/bulgarian/ResBul.gf index d5a67841..adcbad57 100644 --- a/src/bulgarian/ResBul.gf +++ b/src/bulgarian/ResBul.gf @@ -92,7 +92,7 @@ resource ResBul = ParamX - [Tense,Pres,Past,Fut,Cond] ** open Prelude, Predef in -- The order of sentence is needed already in $VP$. - Order = Main | Inv | Quest ; + Order = Main | Inv | Quest | Wh ; --2 For $Adjective$ @@ -162,6 +162,15 @@ resource ResBul = ParamX - [Tense,Pres,Past,Fut,Cond] ** open Prelude, Predef in NounP3 pol => pol; _ => Pos } ; + + conjPronPerson : PronPerson -> PronPerson -> PronPerson = \p1,p2 -> + case of { + | <_,PronP1> => PronP1 ; + | <_,PronP2> => PronP2 ; + | <_,PronP3> => PronP3 ; + | <_,NounP3 Neg> => NounP3 Neg ; + _ => NounP3 Pos + } ; personAgr : GenNum -> PronPerson -> Agr = \gn,p -> {gn = gn; @@ -541,8 +550,9 @@ resource ResBul = ParamX - [Tense,Pres,Past,Fut,Cond] ** open Prelude, Predef in = \\o => vpTenses vp ! t ! a ! p ! agr ! o ! Perf ; compl = vp.compl ! agr in case o of { - Inv => verb ! Inv ++ compl ++ subj ; - o => subj ++ verb ! o ++ compl + Inv => verb ! Inv ++ compl ++ subj ; + Wh => verb ! Wh ++ compl ++ subj ; + o => subj ++ verb ! o ++ compl } } ; @@ -893,7 +903,7 @@ resource ResBul = ParamX - [Tense,Pres,Past,Fut,Cond] ** open Prelude, Predef in s = \\t,a,p,qform => let cls = cl.s ! t ! a ! p ; in wh.s ! qform ++ cls ! case qform of { - QDir => Inv ; + QDir => Wh ; QIndir => Main } } ; diff --git a/src/bulgarian/SentenceBul.gf b/src/bulgarian/SentenceBul.gf index d16e181b..589f772e 100644 --- a/src/bulgarian/SentenceBul.gf +++ b/src/bulgarian/SentenceBul.gf @@ -25,9 +25,10 @@ concrete SentenceBul of Sentence = CatBul ** open Prelude, ResBul in { VPhrasal Dat => personalClitics agr ! Dat++vp.clitics; VPhrasal c => vp.clitics++personalClitics agr ! c } - in case orPol p vp.p of { - Pos => vp.ad.s ++ verb Perf ++ clitic ; - Neg => "не" ++ vp.ad.s ++ clitic ++ verb Imperf + in case of { + => vp.ad.s ++ verb Perf ++ clitic ; + => vp.ad.s ++ "не" ++ clitic ++ verb Imperf ; + _ => "не" ++ vp.ad.s ++ clitic ++ verb Imperf } ++ compl ; } ; diff --git a/src/bulgarian/VerbBul.gf b/src/bulgarian/VerbBul.gf index 8b28633f..2ccba496 100644 --- a/src/bulgarian/VerbBul.gf +++ b/src/bulgarian/VerbBul.gf @@ -131,7 +131,7 @@ concrete VerbBul of Verb = CatBul ** open Prelude, ResBul, ParadigmsBul in { compl1 = vp.compl1 ; compl2 = vp.compl2 ; vtype = vp.vtype ; - p = vp.p ; + p = orPol adv.p vp.p ; c2 = vp.c2 ; isSimple = vp.isSimple ; subjCtrl = vp.subjCtrl