bugfixes from Codex

This commit is contained in:
Krasimir Angelov
2026-09-26 16:57:54 +02:00
parent 4bbc7c7d59
commit a557b49c95
8 changed files with 37 additions and 22 deletions
+2 -2
View File
@@ -60,11 +60,11 @@ concrete ConjunctionBul of Conjunction =
BaseNP x y = BaseNP x y =
{s = \\role=>table {4 => y.s!role; _ => x.s!role}; {s = \\role=>table {4 => y.s!role; _ => x.s!role};
gn = conjGenNum x.gn y.gn; gn = conjGenNum x.gn y.gn;
p = x.p} ; p = conjPronPerson x.p y.p} ;
ConsNP x xs = ConsNP x xs =
{s = \\role=>table {4 => xs.s!role!4; t => x.s!role++linCoord bindComma!t++xs.s!role!t}; {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; gn = conjGenNum xs.gn x.gn;
p = x.p} ; p = conjPronPerson x.p xs.p} ;
BaseAP x y = BaseAP x y =
{s = \\aform,p => table {4 => y.s!aform!p; _ => x.s!aform!p} ; {s = \\aform,p => table {4 => y.s!aform!p; _ => x.s!aform!p} ;
+7
View File
@@ -32,6 +32,13 @@ lin
is_right_VP = mkVP (mkA084 "верен") ; is_right_VP = mkVP (mkA084 "верен") ;
is_wrong_VP = mkVP (mkA079 "грешен") ; is_wrong_VP = mkVP (mkA079 "грешен") ;
n_units_AP card cn a = mkAP (lin AdA (mkUtt (mkNP <lin Card card : Card> (lin CN cn)))) (lin A a) ; n_units_AP card cn a = mkAP (lin AdA (mkUtt (mkNP <lin Card card : Card> (lin CN cn)))) (lin A a) ;
n_units_of_NP card cn np =
let unit = mkNP <lin Card card : Card> (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)) ; 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 lin
+7 -10
View File
@@ -141,24 +141,21 @@ lin
insertObj (\\a => vpi.s ! a) Pos (predV vv) ; insertObj (\\a => vpi.s ! a) Pos (predV vv) ;
lincat lincat
VPS = {s : Agr => Str} ; VPS = {s : Agr => Order => Str} ;
[VPS] = {s : Agr => Ints 4 => Str} ; [VPS] = {s : Agr => Order => Ints 4 => Str} ;
lin lin
BaseVPS x y = {s = \\a=>table {4 => y.s!a; _ => x.s!a}} ; BaseVPS x y = {s = \\a,o=>table {4 => y.s!a!Main; _ => x.s!a!o}} ;
ConsVPS x xs = {s = \\a=>table {4 => xs.s!a!4; t => x.s!a++linCoord bindComma!t++xs.s!a!t}}; 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 = { MkVPS t p vp = {
s = \\a => s = \\a,o => t.s ++ p.s ++ vpTenses vp ! t.t ! t.a ! p.p ! a ! o ! Perf ++ vp.compl ! 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
} ; } ;
ConjVPS conj vps = { 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} ; lincat [Comp] = {s : Agr => Ints 4 => Str} ;
+1 -1
View File
@@ -32,6 +32,7 @@ concrete IdiomBul of Idiom = CatBul ** open Prelude, ParadigmsBul, ResBul in {
in case o of { in case o of {
Main => tenses ! Inv ! Perf ++ 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 ; 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 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}} ; ImpPl1 vp = {s = "нека" ++ daComplex Simul Pos vp ! Perf ! {gn = GPl ; p = P1}} ;
} }
+1 -1
View File
@@ -210,7 +210,7 @@ concrete NounBul of Noun = CatBul ** open ResBul, Prelude in {
GSg Fem => AFem ; GSg Fem => AFem ;
GPl => ANeut 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); gn = gennum ANeut (numnnum det.nn);
p = NounP3 Pos p = NounP3 Pos
} ; } ;
+12 -2
View File
@@ -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$. -- The order of sentence is needed already in $VP$.
Order = Main | Inv | Quest ; Order = Main | Inv | Quest | Wh ;
--2 For $Adjective$ --2 For $Adjective$
@@ -163,6 +163,15 @@ resource ResBul = ParamX - [Tense,Pres,Past,Fut,Cond] ** open Prelude, Predef in
_ => Pos _ => Pos
} ; } ;
conjPronPerson : PronPerson -> PronPerson -> PronPerson = \p1,p2 ->
case <p1,p2> of {
<PronP1,_> | <_,PronP1> => PronP1 ;
<PronP2,_> | <_,PronP2> => PronP2 ;
<PronP3,_> | <_,PronP3> => PronP3 ;
<NounP3 Neg,_> | <_,NounP3 Neg> => NounP3 Neg ;
_ => NounP3 Pos
} ;
personAgr : GenNum -> PronPerson -> Agr = \gn,p -> personAgr : GenNum -> PronPerson -> Agr = \gn,p ->
{gn = gn; {gn = gn;
p = case p of { p = case p of {
@@ -542,6 +551,7 @@ resource ResBul = ParamX - [Tense,Pres,Past,Fut,Cond] ** open Prelude, Predef in
compl = vp.compl ! agr compl = vp.compl ! agr
in case o of { in case o of {
Inv => verb ! Inv ++ compl ++ subj ; Inv => verb ! Inv ++ compl ++ subj ;
Wh => verb ! Wh ++ compl ++ subj ;
o => subj ++ verb ! o ++ compl 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 => s = \\t,a,p,qform =>
let cls = cl.s ! t ! a ! p ; let cls = cl.s ! t ! a ! p ;
in wh.s ! qform ++ cls ! case qform of { in wh.s ! qform ++ cls ! case qform of {
QDir => Inv ; QDir => Wh ;
QIndir => Main QIndir => Main
} }
} ; } ;
+4 -3
View File
@@ -25,9 +25,10 @@ concrete SentenceBul of Sentence = CatBul ** open Prelude, ResBul in {
VPhrasal Dat => personalClitics agr ! Dat++vp.clitics; VPhrasal Dat => personalClitics agr ! Dat++vp.clitics;
VPhrasal c => vp.clitics++personalClitics agr ! c VPhrasal c => vp.clitics++personalClitics agr ! c
} }
in case orPol p vp.p of { in case <p,vp.p> of {
Pos => vp.ad.s ++ verb Perf ++ clitic ; <Pos,Pos> => vp.ad.s ++ verb Perf ++ clitic ;
Neg => "не" ++ vp.ad.s ++ clitic ++ verb Imperf <Pos,Neg> => vp.ad.s ++ "не" ++ clitic ++ verb Imperf ;
_ => "не" ++ vp.ad.s ++ clitic ++ verb Imperf
} ++ compl ; } ++ compl ;
} ; } ;
+1 -1
View File
@@ -131,7 +131,7 @@ concrete VerbBul of Verb = CatBul ** open Prelude, ResBul, ParadigmsBul in {
compl1 = vp.compl1 ; compl1 = vp.compl1 ;
compl2 = vp.compl2 ; compl2 = vp.compl2 ;
vtype = vp.vtype ; vtype = vp.vtype ;
p = vp.p ; p = orPol adv.p vp.p ;
c2 = vp.c2 ; c2 = vp.c2 ;
isSimple = vp.isSimple ; isSimple = vp.isSimple ;
subjCtrl = vp.subjCtrl subjCtrl = vp.subjCtrl