diff --git a/src/bulgarian/CatBul.gf b/src/bulgarian/CatBul.gf index 39278ca4d..a3028a7d4 100644 --- a/src/bulgarian/CatBul.gf +++ b/src/bulgarian/CatBul.gf @@ -68,7 +68,7 @@ concrete CatBul of Cat = CommonX - [IAdv,AdV,SC] ** open ResBul, Prelude, Predef -- Structural - Conj = {s : Str; distr : Bool; conj : Ints 4; n : Number} ; + Conj = {s : Str; sep : Ints 3; n : Number} ; Subj = {s : Str} ; Prep = {s : Str; c : Case} ; @@ -126,11 +126,7 @@ concrete CatBul of Cat = CommonX - [IAdv,AdV,SC] ** open ResBul, Prelude, Predef } in linrefVP vp; - Conj = \conj -> let s = linCoord ! conj.conj - in case conj.distr of { - True => s ++ s; - False => s - } ; + Conj = \conj -> conj.s ; V, VS, VQ, VA = \v -> linrefVP (predV v); V2 = \v -> linrefVP (predV v) ++ linPrep v.c2 ; diff --git a/src/bulgarian/ConjunctionBul.gf b/src/bulgarian/ConjunctionBul.gf index 93cb1f309..88a6ab82f 100644 --- a/src/bulgarian/ConjunctionBul.gf +++ b/src/bulgarian/ConjunctionBul.gf @@ -8,92 +8,92 @@ concrete ConjunctionBul of Conjunction = lin ConjS conj ss = { - s = conj.s ++ (linCoordSep [])!conj.distr!conj.conj++ss.s!conj.distr!conj.conj; + s = linCoord []!conj.sep ++ ss.s!conj.sep ++ conj.s ++ ss.s!4; } ; ConjAdv conj ss = { - s = conj.s ++ (linCoordSep [])!conj.distr!conj.conj++ss.s!conj.distr!conj.conj; + s = linCoord []!conj.sep ++ ss.s!conj.sep ++ conj.s ++ ss.s!4; } ; ConjAdV conj ss = { - s = conj.s ++ (linCoordSep [])!conj.distr!conj.conj++ss.s!conj.distr!conj.conj; + s = linCoord []!conj.sep ++ ss.s!conj.sep ++ conj.s ++ ss.s!4; p = Pos } ; ConjIAdv conj ss = { - s = \\qform => conj.s ++ (linCoordSep [])!conj.distr!conj.conj++ss.s!conj.distr!conj.conj!qform; + s = \\qform => linCoord []!conj.sep ++ ss.s!qform!conj.sep ++ conj.s ++ ss.s!qform!4; } ; ConjNP conj ss = { - s = \\role => conj.s ++ (linCoordSep [])!conj.distr!conj.conj++ss.s!conj.distr!conj.conj!role; + s = \\role => linCoord []!conj.sep ++ ss.s!role!conj.sep ++ conj.s ++ ss.s!role!4; gn = conjGenNum (gennum (AMasc NonHuman) conj.n) ss.gn; p = ss.p } ; ConjAP conj ss = { - s = \\aform,p => conj.s ++ (linCoordSep [])!conj.distr!conj.conj++ss.s!conj.distr!conj.conj!aform!p; - adv = conj.s ++ (linCoordSep [])!conj.distr!conj.conj++ss.adv!conj.distr!conj.conj; + s = \\aform,p => linCoord []!conj.sep ++ ss.s!aform!p!conj.sep ++ conj.s ++ ss.s!aform!p!4; + adv = ss.adv!conj.conj ++ conj.s ++ ss.adv!4; isPre = ss.isPre } ; ConjRS conj ss = { - s = \\role => conj.s ++ (linCoordSep [])!conj.distr!conj.conj++ss.s!conj.distr!conj.conj!role + s = \\role => linCoord []!conj.sep ++ ss.s!role!conj.sep ++ conj.s ++ ss.s!role!4; } ; ConjCN conj ss = { - s = \\nform => conj.s ++ (linCoordSep [])!conj.distr!conj.conj++ss.s!conj.distr!conj.conj!nform; + s = \\nform => linCoord []!conj.sep ++ ss.s!nform!conj.sep ++ conj.s ++ ss.s!nform!4; g = ss.g } ; -- These fun's are generated from the list cat's. - BaseS x y = {s = \\d,t=>x.s++linCoord!t++ y.s} ; - ConsS x xs = {s = \\d,t=>x.s++(linCoordSep comma)!d!t++xs.s!d!t} ; + BaseS x y = {s = table {4 => y.s; _ => x.s}} ; + ConsS x xs = {s = table {4 => xs.s!4; t => x.s++linCoord bindComma!t++xs.s!t}} ; - BaseAdv x y = {s = \\d,t=>x.s++linCoord!t++ y.s} ; - ConsAdv x xs = {s = \\d,t=>x.s++(linCoordSep comma)!d!t++xs.s!d!t} ; + BaseAdv x y = {s = table {4 => y.s; _ => x.s}} ; + ConsAdv x xs = {s = table {4 => xs.s!4; t => x.s++linCoord bindComma!t++xs.s!t}} ; - BaseAdV x y = {s = \\d,t=>x.s++linCoord!t++ y.s} ; - ConsAdV x xs = {s = \\d,t=>x.s++(linCoordSep comma)!d!t++xs.s!d!t} ; + BaseAdV x y = {s = table {4 => y.s; _ => x.s}} ; + ConsAdV x xs = {s = table {4 => xs.s!4; t => x.s++linCoord bindComma!t++xs.s!t}} ; - BaseIAdv x y = {s = \\d,t,qform=>x.s!qform++linCoord!t++ y.s!qform} ; - ConsIAdv x xs = {s = \\d,t,qform=>x.s!qform++(linCoordSep comma)!d!t++xs.s!d!t!qform} ; + BaseIAdv x y = {s = \\qform=>table {4 => y.s!qform; _ => x.s!qform}} ; + ConsIAdv x xs = {s = \\qform=>table {4 => xs.s!qform!4; t => x.s!qform++linCoord bindComma!t++xs.s!qform!t}} ; BaseNP x y = - {s = \\d,t,role=>x.s!role++linCoord!t++y.s!role; + {s = \\role=>table {4 => y.s!role; _ => x.s!role}; gn = conjGenNum x.gn y.gn; p = x.p} ; ConsNP x xs = - {s = \\d,t,role=>x.s!role++(linCoordSep comma)!d!t++xs.s!d!t!role; + {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} ; BaseAP x y = - {s = \\d,t,aform,p => x.s!aform!p++linCoord!t++y.s!aform!p; + {s = \\aform,p => table {4 => y.s!aform!p; _ => x.s!aform!p} ; isPre = andB x.isPre y.isPre} ; ConsAP x xs = - {s = \\d,t,aform,p =>x.s!aform!p++(linCoordSep comma)!d!t++xs.s!d!t!aform!p; - isPre = andB x.isPre xs.isPre} ; + {s = \\aform,p=>table {4 => xs.s!aform!p!4; t => x.s!aform!p++linCoord bindComma!t++xs.s!aform!p!t}; + isPre = andB x.isPre xs.isPre} ; BaseRS x y = - {s = \\d,t,role=>x.s!role++linCoord!t++y.s!role} ; + {s = \\role=>table {4 => y.s!role; _ => x.s!role}} ; ConsRS x xs = - {s = \\d,t,role=>x.s!role++(linCoordSep comma)!d!t++xs.s!d!t!role} ; + {s = \\role=>table {4 => xs.s!role!4; t => x.s!role++linCoord bindComma!t++xs.s!role!t}} ; BaseCN x y = - {s = \\d,t,nform=>x.s!nform++linCoord!t++y.s!nform; + {s = \\nform=>table {4 => y.s!nform; _ => x.s!nform}; g = x.g} ; ConsCN x xs = - {s = \\d,t,nform=>x.s!nform++(linCoordSep comma)!d!t++xs.s!d!t!nform; + {s = \\nform=>table {4 => xs.s!nform!4; t => x.s!nform++linCoord bindComma!t++xs.s!nform!t}; g = x.g} ; lincat - [S] = {s : Bool => Ints 4 => Str} ; - [Adv] = {s : Bool => Ints 4 => Str} ; - [AdV] = {s : Bool => Ints 4 => Str} ; - [IAdv] = {s : Bool => Ints 4 => QForm => Str} ; - [NP] = {s : Bool => Ints 4 => Role => Str; gn : GenNum; p : PronPerson} ; - [AP] = {s : Bool => Ints 4 => AForm => Person => Str; isPre : Bool} ; - [RS] = {s : Bool => Ints 4 => Agr => Str} ; - [CN] = {s : Bool => Ints 4 => NForm => Str; g : AGender} ; + [S] = {s : Ints 4 => Str} ; + [Adv] = {s : Ints 4 => Str} ; + [AdV] = {s : Ints 4 => Str} ; + [IAdv] = {s : QForm => Ints 4 => Str} ; + [NP] = {s : Role => Ints 4 => Str; gn : GenNum; p : PronPerson} ; + [AP] = {s : AForm => Person => Ints 4 => Str; isPre : Bool} ; + [RS] = {s : Agr => Ints 4 => Str} ; + [CN] = {s : NForm => Ints 4 => Str; g : AGender} ; } diff --git a/src/bulgarian/ExtendBul.gf b/src/bulgarian/ExtendBul.gf index f2abbb1b8..69f728ef0 100644 --- a/src/bulgarian/ExtendBul.gf +++ b/src/bulgarian/ExtendBul.gf @@ -112,11 +112,11 @@ lin lincat VPS = {s : Agr => Str} ; - [VPS] = {s : Bool => Ints 4 => Agr => Str} ; + [VPS] = {s : Agr => Ints 4 => Str} ; lin - BaseVPS x y = {s = \\d,t,a=>x.s!a++linCoord!t++y.s!a} ; - ConsVPS x xs = {s = \\d,t,a=>x.s!a++(linCoordSep bindComma)!d!t++xs.s!d!t!a} ; + 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}}; PredVPS np vps = {s = np.s ! RSubj ++ vps.s ! personAgr np.gn np.p} ; @@ -128,7 +128,7 @@ lin } ; ConjVPS conj vps = { - s = \\a => conj.s++(linCoordSep [])!conj.distr!conj.conj++vps.s!conj.distr!conj.conj!a; + s = \\a => linCoord []!conj.sep ++ vps.s!a!conj.sep ++ conj.s ++ vps.s!a!4 } ; lin diff --git a/src/bulgarian/ExtraBul.gf b/src/bulgarian/ExtraBul.gf index bcd3212d4..9eb18fc1b 100644 --- a/src/bulgarian/ExtraBul.gf +++ b/src/bulgarian/ExtraBul.gf @@ -57,26 +57,26 @@ concrete ExtraBul of ExtraBulAbs = CatBul ** lincat VPI = {s : Agr => Str} ; - [VPI] = {s : Bool => Ints 4 => Agr => Str} ; + [VPI] = {s : Agr => Ints 4 => 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 bindComma)!d!t++xs.s!d!t!a} ; + BaseVPI x y = {s = \\a=>table {4 => y.s!a; _ => x.s!a}} ; + ConsVPI x xs = {s = \\a=>table {4 => xs.s!a!4; t => x.s!a++linCoord bindComma!t++xs.s!a!t}}; MkVPI vp = {s = daComplex Simul Pos vp ! Perf} ; ConjVPI conj vpi = { - s = \\a => conj.s++(linCoordSep [])!conj.distr!conj.conj++vpi.s!conj.distr!conj.conj!a; + s = \\a => linCoord []!conj.sep ++ vpi.s!a!conj.sep ++ conj.s ++ vpi.s!a!4 } ; ComplVPIVV vv vpi = insertObj (\\a => vpi.s ! a) Pos (predV vv) ; lincat VPS = {s : Agr => Str} ; - [VPS] = {s : Bool => Ints 4 => Agr => Str} ; + [VPS] = {s : Agr => Ints 4 => Str} ; lin - BaseVPS x y = {s = \\d,t,a=>x.s!a++linCoord!t++y.s!a} ; - ConsVPS x xs = {s = \\d,t,a=>x.s!a++(linCoordSep bindComma)!d!t++xs.s!d!t!a} ; + 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}}; PredVPS np vps = {s = np.s ! RSubj ++ vps.s ! personAgr np.gn np.p} ; @@ -88,7 +88,7 @@ concrete ExtraBul of ExtraBulAbs = CatBul ** } ; ConjVPS conj vps = { - s = \\a => conj.s++(linCoordSep [])!conj.distr!conj.conj++vps.s!conj.distr!conj.conj!a; + s = \\a => linCoord []!conj.sep ++ vps.s!a!conj.sep ++ conj.s ++ vps.s!a!4 } ; PassVPSlash vp = insertObj (\\a => vp.ad.s ++ vp.s ! Perf ! VPassive (aform a.gn Indef (RObj Acc)) ++ diff --git a/src/bulgarian/MorphoFunsBul.gf b/src/bulgarian/MorphoFunsBul.gf index 7b363594f..7f82f11ac 100644 --- a/src/bulgarian/MorphoFunsBul.gf +++ b/src/bulgarian/MorphoFunsBul.gf @@ -268,6 +268,11 @@ oper noPrep : Prep = mkPrep [] Acc ; +--2 Conjunctions + + mkConj : Str -> Number -> Conj = + \s,n -> {s = s; sep = 3; n = n; lock_Conj = <>} ; + --2 Proper Names -- mkPN : Str -> Gender -> PN ; diff --git a/src/bulgarian/PhraseBul.gf b/src/bulgarian/PhraseBul.gf index 48bfd8f3c..8a41ad3d0 100644 --- a/src/bulgarian/PhraseBul.gf +++ b/src/bulgarian/PhraseBul.gf @@ -23,7 +23,7 @@ concrete PhraseBul of Phrase = CatBul ** open Prelude, ResBul in { UttInterj i = i ; NoPConj = {s = []} ; - PConjConj conj = {s = conj.s ++ linCoord!conj.conj} ; + PConjConj conj = {s = conj.s} ; NoVoc = {s = []} ; VocNP np = {s = bindComma ++ np.s ! RVoc} ; diff --git a/src/bulgarian/ResBul.gf b/src/bulgarian/ResBul.gf index 9b2e10db4..13ce1c015 100644 --- a/src/bulgarian/ResBul.gf +++ b/src/bulgarian/ResBul.gf @@ -827,11 +827,8 @@ resource ResBul = ParamX ** open Prelude, Predef in { GPl => "тези" } ; - linCoord : Ints 4 => Str ; - linCoord = table {0 => "и"; 1=>"или"; 2=>"нито"; 3=>"но"; 4=>"вместо"} ; - - linCoordSep : Str -> Bool => Ints 4 => Str ; - linCoordSep s = table {True => linCoord; False=> \\_ => s} ; + linCoord : Str -> Ints 4 => Str ; + linCoord comma = table {0 => "и"; 1=>"или"; 2=>"нито"; 3=>comma; 4=>[]} ; hyphen : Str = SOFT_BIND ++ "-" ++ SOFT_BIND ; diff --git a/src/bulgarian/StructuralBul.gf b/src/bulgarian/StructuralBul.gf index 677fea018..770155e0f 100644 --- a/src/bulgarian/StructuralBul.gf +++ b/src/bulgarian/StructuralBul.gf @@ -14,18 +14,18 @@ concrete StructuralBul of Structural = CatBul ** at_least_AdN, at_most_AdN = ss "почти" ; ---- AR although_Subj = ss ["въпреки че"] ; always_AdV = mkAdV "винаги" ; - and_Conj = {s=[]; conj=0; distr=False; n = Pl} ; + and_Conj = mkConj "и" Pl ; because_Subj = ss "защото" ; before_Prep = mkPrep "преди" ; behind_Prep = mkPrep "зад" ; between_Prep = mkPrep "между" ; - both7and_DConj = {s=[]; conj=0; distr=True; n = Pl} ; + both7and_DConj = mkConj "и" Pl ** {sep=0} ; but_PConj = ss "но" ; by8agent_Prep = mkPrep "чрез" ; by8means_Prep = mkPrep "чрез" ; can8know_VV, can_VV = mkVV (stateV (mkV166 "мога")) ; during_Prep = mkPrep ["по време на"] ; - either7or_DConj = {s=[]; conj=1; distr=True; n = Sg} ; + either7or_DConj = mkConj "или" Sg ** {sep=1} ; everybody_NP = mkNP "всеки" (GSg Masc) (NounP3 Pos); every_Det = mkDeterminerSg "всеки" "всяка" "всяко"; everything_NP = mkNP "всичко" (GSg Neut) (NounP3 Pos); @@ -75,7 +75,7 @@ concrete StructuralBul of Structural = CatBul ** on_Prep = mkPrep "на" ; ---- one_Quant = mkDeterminer Sg "one" ; -- DEPRECATED only_Predet = {s = \\_ => "само"} ; - or_Conj = {s=[]; conj=1; distr=False; n = Sg} ; + or_Conj = mkConj "или" Sg ; otherwise_PConj = ss "иначе" ; part_Prep = mkPrep "от" ; please_Voc = ss "моля" ;