diff --git a/lib/src/bulgarian/CatBul.gf b/lib/src/bulgarian/CatBul.gf index 92c3c7c27..6781d8ea7 100644 --- a/lib/src/bulgarian/CatBul.gf +++ b/lib/src/bulgarian/CatBul.gf @@ -1,4 +1,4 @@ -concrete CatBul of Cat = CommonX - [IAdv,CAdv] ** open ResBul, Prelude, (R = ParamX) in { +concrete CatBul of Cat = CommonX - [IAdv,CAdv] ** open ResBul, Prelude, Predef, (R = ParamX) in { flags coding=cp1251; optimize=all_subs; @@ -54,10 +54,10 @@ concrete CatBul of Cat = CommonX - [IAdv,CAdv] ** open ResBul, Prelude, (R = Par CN = {s : NForm => Str; g : AGender} ; NP = {s : Role => Str; a : Agr} ; Pron = {s : Role => Str; gen : AForm => Str; a : Agr} ; - Det = {s : Bool => AGender => Role => Str; n : Number; countable : Bool; spec : Species} ; + Det = {s : Bool => AGender => Role => Str; nn : NNumber; spec : Species} ; Predet = {s : GenNum => Str} ; Ord = {s : AForm => Str} ; - Num = {s : CardForm => Str; n : Number; nonEmpty : Bool} ; + Num = {s : CardForm => Str; nn : NNumber; nonEmpty : Bool} ; Card = {s : CardForm => Str; n : Number} ; Quant = {s : Bool => AForm => Str; nonEmpty : Bool; spec : Species} ; @@ -68,7 +68,7 @@ concrete CatBul of Cat = CommonX - [IAdv,CAdv] ** open ResBul, Prelude, (R = Par -- Structural - Conj = {s : Str; distr : Bool; conj : Bool; n : Number} ; + Conj = {s : Str; distr : Bool; conj : Ints 2; n : Number} ; Subj = {s : Str} ; Prep = {s : Str; c : Case} ; diff --git a/lib/src/bulgarian/ConjunctionBul.gf b/lib/src/bulgarian/ConjunctionBul.gf index 21b3c3bfb..c02f9f88a 100644 --- a/lib/src/bulgarian/ConjunctionBul.gf +++ b/lib/src/bulgarian/ConjunctionBul.gf @@ -1,5 +1,5 @@ concrete ConjunctionBul of Conjunction = - CatBul ** open ResBul, Coordination, Prelude in { + CatBul ** open ResBul, Coordination, Prelude, Predef in { flags coding=cp1251 ; @@ -59,9 +59,9 @@ concrete ConjunctionBul of Conjunction = isPre = andB x.isPre xs.isPre} ; lincat - [S] = {s : Bool => Bool => Str} ; - [Adv] = {s : Bool => Bool => Str} ; - [NP] = {s : Bool => Bool => Role => Str; a : Agr} ; - [RS] = {s : Bool => Bool => Agr => Str} ; - [AP] = {s : Bool => Bool => AForm => Str; adv : Bool => Bool => Str; isPre : Bool} ; + [S] = {s : Bool => Ints 2 => Str} ; + [Adv] = {s : Bool => Ints 2 => Str} ; + [NP] = {s : Bool => Ints 2 => Role => Str; a : Agr} ; + [RS] = {s : Bool => Ints 2 => Agr => Str} ; + [AP] = {s : Bool => Ints 2 => AForm => Str; adv : Bool => Ints 2 => Str; isPre : Bool} ; } diff --git a/lib/src/bulgarian/ExtraBul.gf b/lib/src/bulgarian/ExtraBul.gf index 3d66955fa..b86c33fd1 100644 --- a/lib/src/bulgarian/ExtraBul.gf +++ b/lib/src/bulgarian/ExtraBul.gf @@ -1,5 +1,5 @@ concrete ExtraBul of ExtraBulAbs = CatBul ** - open ResBul, MorphoFunsBul, Coordination, Prelude in { + open ResBul, MorphoFunsBul, Coordination, Prelude, Predef in { flags coding=cp1251 ; @@ -38,7 +38,7 @@ concrete ExtraBul of ExtraBulAbs = CatBul ** CFMasc Indef _ | CFFem Indef | CFNeut Indef => "едни" ; CFMasc Def _ | CFMascDefNom _ | CFFem Def | CFNeut Def => "едните" } ; - n = Pl; + nn = NCountable; nonEmpty = True } ; @@ -68,9 +68,24 @@ concrete ExtraBul of ExtraBulAbs = CatBul ** APl _ => APl Indef } ; + lincat + VPI = {s : Agr => Str} ; + [VPI] = {s : Bool => Ints 2 => Agr => Str} ; + + lin + BaseVPI x y = {s = \\d,t,a=>x.s!a++linCoord!t++y.s!a} ; + ConsVPI x xs = {s = \\d,t,a=>x.s!a++(linCoordSep comma)!d!t++xs.s!d!t!a} ; + + MkVPI vp = {s = daComplex vp ! Perf} ; + ConjVPI conj vpi = { + s = \\a => conj.s++(linCoordSep [])!conj.distr!conj.conj++vpi.s!conj.distr!conj.conj!a; + } ; + ComplVPIVV vv vpi = + insertObj (\\a => vpi.s ! a) (predV vv) ; + lincat VPS = {s : Agr => Str} ; - [VPS] = {s : Bool => Bool => Agr => Str} ; + [VPS] = {s : Bool => Ints 2 => Agr => Str} ; lin BaseVPS x y = {s = \\d,t,a=>x.s!a++linCoord!t++y.s!a} ; @@ -86,7 +101,7 @@ concrete ExtraBul of ExtraBulAbs = CatBul ** } ; ConjVPS conj vps = { - s = \\a => (linCoordSep [])!conj.distr!conj.conj++vps.s!conj.distr!conj.conj!a; + s = \\a => conj.s++(linCoordSep [])!conj.distr!conj.conj++vps.s!conj.distr!conj.conj!a; } ; PassVPSlash vp = insertObj (\\a => vp.s ! Perf ! VPassive (aform a.gn Indef (RObj Acc)) ++ diff --git a/lib/src/bulgarian/MorphoBul.gf b/lib/src/bulgarian/MorphoBul.gf index 169d4e362..a3d762072 100644 --- a/lib/src/bulgarian/MorphoBul.gf +++ b/lib/src/bulgarian/MorphoBul.gf @@ -21,10 +21,10 @@ resource MorphoBul = ResBul ** open oper --2 Determiners - mkDeterminerSg : Str -> Str -> Str -> {s : Bool => AGender => Role => Str; n : Number; countable : Bool ; spec : Species} = \vseki,vsiaka,vsiako -> - {s = \\_,g,_ => table AGender [vseki;vseki;vsiaka;vsiako] ! g; n = Sg; countable = False; spec = Indef} ; - mkDeterminerPl : Str -> {s : Bool => AGender => Role => Str ; n : Number; countable : Bool ; spec : Species} = \vsicki -> - {s = \\_,_,_ => vsicki; sp = \\_,_ => vsicki; n = Pl; countable = False; spec = Indef} ; + mkDeterminerSg : Str -> Str -> Str -> {s : Bool => AGender => Role => Str; nn : NNumber; spec : Species} = \vseki,vsiaka,vsiako -> + {s = \\_,g,_ => table AGender [vseki;vseki;vsiaka;vsiako] ! g; nn = NNum Sg; spec = Indef} ; + mkDeterminerPl : Str -> {s : Bool => AGender => Role => Str ; nn : NNumber ; spec : Species} = \vsicki -> + {s = \\_,_,_ => vsicki; sp = \\_,_ => vsicki; nn = NNum Pl; spec = Indef} ; mkQuant : Str -> Str -> Str -> Str -> {s : Bool => AForm => Str; nonEmpty : Bool; spec : Species} = \tozi,tazi,towa,tezi -> { s = \\_ => table { diff --git a/lib/src/bulgarian/NounBul.gf b/lib/src/bulgarian/NounBul.gf index 36940e445..8c054056b 100644 --- a/lib/src/bulgarian/NounBul.gf +++ b/lib/src/bulgarian/NounBul.gf @@ -3,31 +3,30 @@ concrete NounBul of Noun = CatBul ** open ResBul, Prelude in { lin DetCN det cn = - { s = \\role => let nf = case of { - => case role of { - RSubj => NFSgDefNom ; - RVoc => NFVocative ; - _ => NF Sg Def - } ; - => case role of { - RVoc => NFVocative ; - _ => NF Sg Indef - } ; - => NF det.n det.spec ; - => case cn.g of { - AMasc Human => NF Pl Indef; - _ => case det.countable of { - True => NFPlCount ; - False => NF Pl Indef - } - } + { s = \\role => let nf = case of { + => case role of { + RSubj => NFSgDefNom ; + RVoc => NFVocative ; + _ => NF Sg Def + } ; + => case role of { + RVoc => NFVocative ; + _ => NF Sg Indef + } ; + => NF Pl Def ; + => NF Pl Indef; + => NF Pl det.spec ; + => case cn.g of { + AMasc Human => NF Pl Indef; + _ => NFPlCount + } } ; s = det.s ! True ! cn.g ! role ++ cn.s ! nf in case role of { RObj Dat => "на" ++ s; _ => s } ; - a = {gn = gennum cn.g det.n; p = P3} ; + a = {gn = gennum cn.g (numnnum det.nn); p = P3} ; } ; DetNP det = @@ -36,7 +35,7 @@ concrete NounBul of Noun = CatBul ** open ResBul, Prelude in { RObj Dat => "на" ++ s; _ => s } ; - a = {gn = gennum ANeut det.n; p = P3} ; + a = {gn = gennum ANeut (numnnum det.nn); p = P3} ; } ; UsePN pn = { s = table { @@ -65,19 +64,17 @@ concrete NounBul of Noun = CatBul ** open ResBul, Prelude in { DetQuant quant num = { s = \\sp,g,c => let sp' = case num.nonEmpty of { True => True ; False => sp } - in quant.s ! sp' ! aform (gennum g num.n) (case c of {RVoc=>Indef; _=>Def}) c ++ + in quant.s ! sp' ! aform (gennum g (numnnum num.nn)) (case c of {RVoc=>Indef; _=>Def}) c ++ num.s ! dgenderSpecies g quant.spec c ; - n = num.n ; - countable = num.nonEmpty ; + nn = num.nn ; spec = case num.nonEmpty of {True=>Indef; _=>quant.spec} } ; DetQuantOrd = \quant, num, ord -> { - s = \\_,g,c => quant.s ! True ! aform (gennum g num.n) (case c of {RVoc=>Indef; _=>Def}) c ++ + s = \\_,g,c => quant.s ! True ! aform (gennum g (numnnum num.nn)) (case c of {RVoc=>Indef; _=>Def}) c ++ num.s ! dgenderSpecies g quant.spec c ++ - ord.s ! aform (gennum g num.n) (case num.nonEmpty of {True=>Indef; _=>quant.spec}) c ; - n = num.n ; - countable = num.nonEmpty ; + ord.s ! aform (gennum g (numnnum num.nn)) (case num.nonEmpty of {True=>Indef; _=>quant.spec}) c ; + nn = num.nn ; spec=Indef } ; @@ -87,10 +84,10 @@ concrete NounBul of Noun = CatBul ** open ResBul, Prelude in { spec = ResBul.Indef } ; - NumSg = {s = \\_ => []; n = Sg; nonEmpty = False} ; - NumPl = {s = \\_ => []; n = Pl; nonEmpty = False} ; + NumSg = {s = \\_ => []; nn = NNum Sg; nonEmpty = False} ; + NumPl = {s = \\_ => []; nn = NNum Pl; nonEmpty = False} ; - NumCard n = n ** {nonEmpty = True} ; + NumCard n = {s=n.s; nn=case n.n of {Sg => NNum Sg; Pl => NCountable}; nonEmpty = True} ; NumDigits n = {s = \\gspec => n.s ! NCard gspec; n = n.n} ; OrdDigits n = {s = \\aform => n.s ! NOrd aform} ; diff --git a/lib/src/bulgarian/QuestionBul.gf b/lib/src/bulgarian/QuestionBul.gf index 0892fa2f5..351dcaf68 100644 --- a/lib/src/bulgarian/QuestionBul.gf +++ b/lib/src/bulgarian/QuestionBul.gf @@ -53,9 +53,9 @@ concrete QuestionBul of Question = CatBul ** open ResBul, Prelude in { } ; IdetQuant iquant num = { - s = \\g,qform => iquant.s ! gennum g num.n ! qform ++ + s = \\g,qform => iquant.s ! gennum g (numnnum num.nn) ! qform ++ num.s ! dgenderSpecies g Indef RSubj ; - n = num.n ; + n = numnnum num.nn ; nonEmpty = num.nonEmpty } ; diff --git a/lib/src/bulgarian/ResBul.gf b/lib/src/bulgarian/ResBul.gf index 170b6b71a..c09264838 100644 --- a/lib/src/bulgarian/ResBul.gf +++ b/lib/src/bulgarian/ResBul.gf @@ -7,7 +7,7 @@ -- implement $Test$, it moreover contains regular lexical -- patterns needed for $Lex$. -resource ResBul = ParamX ** open Prelude in { +resource ResBul = ParamX ** open Prelude, Predef in { flags coding=cp1251 ; optimize=all ; @@ -29,6 +29,11 @@ resource ResBul = ParamX ** open Prelude in { | NFPlCount | NFVocative ; + + NNumber = + NNum Number + | NCountable + ; GenNum = GSg Gender | GPl ; @@ -133,6 +138,12 @@ resource ResBul = ParamX ** open Prelude in { GPl => Pl } ; + numnnum : NNumber -> Number = \nn -> + case nn of { + NNum n => n ; + NCountable => Pl + } ; + aform : GenNum -> Species -> Role -> AForm = \gn,spec,role -> case gn of { GSg g => case of { @@ -636,9 +647,9 @@ resource ResBul = ParamX ** open Prelude in { GPl => "тези" } ; - linCoord : Bool => Str ; - linCoord = table {True => "и"; False=>"или"} ; + linCoord : Ints 2 => Str ; + linCoord = table {0 => "и"; 1=>"или"; 2=>"нито"} ; - linCoordSep : Str -> Bool => Bool => Str ; + linCoordSep : Str -> Bool => Ints 2 => Str ; linCoordSep s = table {True => linCoord; False=> \\_ => s} ; } diff --git a/lib/src/bulgarian/StructuralBul.gf b/lib/src/bulgarian/StructuralBul.gf index 7fd25bf6f..e09d12935 100644 --- a/lib/src/bulgarian/StructuralBul.gf +++ b/lib/src/bulgarian/StructuralBul.gf @@ -12,23 +12,23 @@ concrete StructuralBul of Structural = CatBul ** almost_AdA, almost_AdN = ss "почти" ; although_Subj = ss ["въпреки че"] ; always_AdV = ss "винаги" ; - and_Conj = {s=[]; conj=True; distr=False; n = Pl} ; + and_Conj = {s=[]; conj=0; distr=False; n = Pl} ; because_Subj = ss "защото" ; before_Prep = mkPrep "преди" Acc ; behind_Prep = mkPrep "зад" Acc ; between_Prep = mkPrep "между" Acc ; - both7and_DConj = {s=[]; conj=True; distr=True; n = Pl} ; + both7and_DConj = {s=[]; conj=0; distr=True; n = Pl} ; but_PConj = ss "но" ; by8agent_Prep = mkPrep "чрез" Acc ; by8means_Prep = mkPrep "чрез" Acc ; can8know_VV, can_VV = mkVV (stateV (mkV166 "мога")) ; during_Prep = mkPrep ["по време на"] Acc ; - either7or_DConj = {s=[]; conj=False; distr=True; n = Sg} ; + either7or_DConj = {s=[]; conj=1; distr=True; n = Sg} ; everybody_NP = mkNP "всеки" (GSg Masc) P3 ; every_Det = mkDeterminerSg "всеки" "всяка" "всяко"; everything_NP = mkNP "всичко" (GSg Neut) P3 ; everywhere_Adv = ss "навсякъде" ; - few_Det = {s = \\_,_,_ => "няколко"; n = Pl; countable = True; spec = Indef} ; + few_Det = {s = \\_,_,_ => "няколко"; nn = NCountable; spec = Indef} ; --- first_Ord = ss "first" ; DEPRECATED for_Prep = mkPrep "за" Acc ; from_Prep = mkPrep "от" Acc ; @@ -73,7 +73,7 @@ concrete StructuralBul of Structural = CatBul ** on_Prep = mkPrep "на" Acc ; ---- one_Quant = mkDeterminer Sg "one" ; -- DEPRECATED only_Predet = {s = \\_ => "само"} ; - or_Conj = {s=[]; conj=False; distr=False; n = Sg} ; + or_Conj = {s=[]; conj=1; distr=False; n = Sg} ; otherwise_PConj = ss "иначе" ; part_Prep = mkPrep "от" Acc ; please_Voc = ss "моля" ; diff --git a/lib/src/bulgarian/SymbolBul.gf b/lib/src/bulgarian/SymbolBul.gf index 343c6971c..48c1efba9 100644 --- a/lib/src/bulgarian/SymbolBul.gf +++ b/lib/src/bulgarian/SymbolBul.gf @@ -15,8 +15,8 @@ lin a = agrP3 (gennum cn.g Sg) } ; CNSymbNP det cn xs = { - s = \\c => det.s ! False ! cn.g ! RSubj ++ cn.s ! NF det.n Indef ++ xs.s ; - a = agrP3 (gennum cn.g det.n) + s = \\c => det.s ! False ! cn.g ! RSubj ++ cn.s ! NF (numnnum det.nn) Indef ++ xs.s ; + a = agrP3 (gennum cn.g (numnnum det.nn)) } ; CNNumNP cn i = { s = \\c => (cn.s ! NF Sg Indef ++ i.s ! CFNeut Indef) ; diff --git a/lib/src/bulgarian/VerbBul.gf b/lib/src/bulgarian/VerbBul.gf index fa5104d48..0e11e9432 100644 --- a/lib/src/bulgarian/VerbBul.gf +++ b/lib/src/bulgarian/VerbBul.gf @@ -69,6 +69,7 @@ concrete VerbBul of Verb = CatBul ** open Prelude, ResBul, ParadigmsBul in { UseComp comp = insertObj comp.s (predV verbBe) ; AdvVP vp adv = insertObj (\\_ => adv.s) vp ; + AdvVPSlash vp adv = insertSlashObj1 (\\_ => adv.s) vp ; AdVVP adv vp = { s = vp.s ;