(Bul) Change encodings from CP1251 to UTF8 (#343)

This commit is contained in:
John J. Camilleri
2020-06-17 09:17:56 +02:00
committed by GitHub
parent 71782b8e04
commit e199fbbb0c
24 changed files with 1911 additions and 1909 deletions
+172 -172
View File
@@ -1,5 +1,5 @@
--# -path=.:../abstract:../common:../../prelude
--# -coding=cp1251
--# -coding=utf8
--1 Bulgarian auxiliary operations.
@@ -11,7 +11,7 @@
resource ResBul = ParamX ** open Prelude, Predef in {
flags
coding=cp1251 ; optimize=all ;
coding=utf8 ; optimize=all ;
-- Some parameters, such as $Number$, are inherited from $ParamX$.
@@ -328,149 +328,149 @@ resource ResBul = ParamX ** open Prelude, Predef in {
auxBe : VTable =
table {
VPres Sg P1 => "ñúì" ;
VPres Sg P2 => "ñè" ;
VPres Sg P3 => "å" ;
VPres Pl P1 => "ñìå" ;
VPres Pl P2 => "ñòå" ;
VPres Pl P3 => "ñà" ;
VAorist Sg P1 => "áÿõ" ;
VAorist Sg _ => "áåøå" ;
VAorist Pl P1 => "áÿõìå" ;
VAorist Pl P2 => "áÿõòå" ;
VAorist Pl P3 => "áÿõà" ;
VImperfect Sg P1 => "áÿõ" ;
VImperfect Sg _ => "áåøå" ;
VImperfect Pl P1 => "áÿõìå" ;
VImperfect Pl P2 => "áÿõòå" ;
VImperfect Pl P3 => "áÿõà" ;
VPerfect aform => regAdjective "áèë" ! aform ;
VPluPerfect aform => regAdjective "áèë" ! aform ;
VPassive aform => regAdjective "áúäåí" ! aform ;
VPresPart aform => regAdjective "áúäåù" ! aform ;
VImperative Sg => "áúäè" ;
VImperative Pl => "áúäåòå" ;
VNoun _ => "áúäåíå";
VGerund => "áèäåéêè"
VPres Sg P1 => "съм" ;
VPres Sg P2 => "си" ;
VPres Sg P3 => "е" ;
VPres Pl P1 => "сме" ;
VPres Pl P2 => "сте" ;
VPres Pl P3 => "са" ;
VAorist Sg P1 => "бях" ;
VAorist Sg _ => "беше" ;
VAorist Pl P1 => "бяхме" ;
VAorist Pl P2 => "бяхте" ;
VAorist Pl P3 => "бяха" ;
VImperfect Sg P1 => "бях" ;
VImperfect Sg _ => "беше" ;
VImperfect Pl P1 => "бяхме" ;
VImperfect Pl P2 => "бяхте" ;
VImperfect Pl P3 => "бяха" ;
VPerfect aform => regAdjective "бил" ! aform ;
VPluPerfect aform => regAdjective "бил" ! aform ;
VPassive aform => regAdjective "бъден" ! aform ;
VPresPart aform => regAdjective "бъдещ" ! aform ;
VImperative Sg => "бъди" ;
VImperative Pl => "бъдете" ;
VNoun _ => "бъдене";
VGerund => "бидейки"
} ;
auxWould : VTable =
table {
VPres Sg P1 => "áúäà" ;
VPres Sg P2 => "áúäåø" ;
VPres Sg P3 => "áúäå" ;
VPres Pl P1 => "áúäåì" ;
VPres Pl P2 => "áúäåòå" ;
VPres Pl P3 => "áúäàò" ;
VAorist Sg P1 => "áÿõ" ;
VAorist Sg _ => "áåøå" ;
VAorist Pl P1 => "áÿõìå" ;
VAorist Pl P2 => "áÿõòå" ;
VAorist Pl P3 => "áÿõà" ;
VImperfect Sg P1 => "áúäåõ" ;
VImperfect Sg _ => "áúäåøå" ;
VImperfect Pl P1 => "áúäåõìå" ;
VImperfect Pl P2 => "áúäåõòå" ;
VImperfect Pl P3 => "áúäåõà" ;
VPerfect aform => regAdjective "áèë" ! aform ;
VPluPerfect aform => regAdjective "áúäåë" ! aform ;
VPassive aform => regAdjective "áúäåí" ! aform ;
VPresPart aform => regAdjective "áúäåù" ! aform ;
VImperative Sg => "áúäè" ;
VImperative Pl => "áúäåòå" ;
VNoun _ => "áúäåíå";
VGerund => "áúäåéêè"
VPres Sg P1 => "бъда" ;
VPres Sg P2 => "бъдеш" ;
VPres Sg P3 => "бъде" ;
VPres Pl P1 => "бъдем" ;
VPres Pl P2 => "бъдете" ;
VPres Pl P3 => "бъдат" ;
VAorist Sg P1 => "бях" ;
VAorist Sg _ => "беше" ;
VAorist Pl P1 => "бяхме" ;
VAorist Pl P2 => "бяхте" ;
VAorist Pl P3 => "бяха" ;
VImperfect Sg P1 => "бъдех" ;
VImperfect Sg _ => "бъдеше" ;
VImperfect Pl P1 => "бъдехме" ;
VImperfect Pl P2 => "бъдехте" ;
VImperfect Pl P3 => "бъдеха" ;
VPerfect aform => regAdjective "бил" ! aform ;
VPluPerfect aform => regAdjective "бъдел" ! aform ;
VPassive aform => regAdjective "бъден" ! aform ;
VPresPart aform => regAdjective "бъдещ" ! aform ;
VImperative Sg => "бъди" ;
VImperative Pl => "бъдете" ;
VNoun _ => "бъдене";
VGerund => "бъдейки"
} ;
auxCond : Number => Person => Str =
table {
Sg => table {
P1 => "áèõ" ;
_ => "áè"
P1 => "бих" ;
_ => "би"
} ;
Pl => table {
P1 => "áèõìå" ;
P2 => "áèõòå" ;
P3 => "áèõà"
P1 => "бихме" ;
P2 => "бихте" ;
P3 => "биха"
}
} ;
verbBe : Verb = {s=table Aspect [auxBe; auxWould] ; vtype=VNormal} ;
reflClitics : Case => Str = table {Acc => "ñå"; Dat => "ñè"; WithPrep => with_Word ++ "ñåáå ñè"; CPrep => "ñåáå ñè"} ;
reflClitics : Case => Str = table {Acc => "се"; Dat => "си"; WithPrep => with_Word ++ "себе си"; CPrep => "себе си"} ;
personalClitics : Agr -> Case => Str = \agr ->
table {
Acc => case agr.gn of {
GSg g => case agr.p of {
P1 => "ìå" ;
P2 => "òå" ;
P1 => "ме" ;
P2 => "те" ;
P3 => case g of {
Masc => "ãî" ;
Fem => "ÿ" ;
Neut => "ãî"
Masc => "го" ;
Fem => "я" ;
Neut => "го"
}
} ;
GPl => case agr.p of {
P1 => "íè" ;
P2 => "âè" ;
P3 => "ãè"
P1 => "ни" ;
P2 => "ви" ;
P3 => "ги"
}
} ;
Dat => case agr.gn of {
GSg g => case agr.p of {
P1 => "ìè" ;
P2 => "òè" ;
P1 => "ми" ;
P2 => "ти" ;
P3 => case g of {
Masc => "ìó" ;
Fem => "é" ;
Neut => "ìó"
Masc => "му" ;
Fem => "й" ;
Neut => "му"
}
} ;
GPl => case agr.p of {
P1 => "íè" ;
P2 => "âè" ;
P3 => "èì"
P1 => "ни" ;
P2 => "ви" ;
P3 => "им"
}
} ;
WithPrep => case agr.gn of {
GSg g => case agr.p of {
P1 => with_Word ++ "ìåí" ;
P2 => with_Word ++ "òåá" ;
P1 => with_Word ++ "мен" ;
P2 => with_Word ++ "теб" ;
P3 => case g of {
Masc => with_Word ++ "íåãî" ;
Fem => with_Word ++ "íåÿ" ;
Neut => with_Word ++ "íåãî"
Masc => with_Word ++ "него" ;
Fem => with_Word ++ "нея" ;
Neut => with_Word ++ "него"
}
} ;
GPl => case agr.p of {
P1 => with_Word ++ "íàñ" ;
P2 => with_Word ++ "âàñ" ;
P3 => with_Word ++ "òÿõ"
P1 => with_Word ++ "нас" ;
P2 => with_Word ++ "вас" ;
P3 => with_Word ++ "тях"
}
} ;
CPrep => case agr.gn of {
GSg g => case agr.p of {
P1 => "ìåí" ;
P2 => "òåá" ;
P1 => "мен" ;
P2 => "теб" ;
P3 => case g of {
Masc => "íåãî" ;
Fem => "íåÿ" ;
Neut => "íåãî"
Masc => "него" ;
Fem => "нея" ;
Neut => "него"
}
} ;
GPl => case agr.p of {
P1 => "íàñ" ;
P2 => "âàñ" ;
P3 => "òÿõ"
P1 => "нас" ;
P2 => "вас" ;
P3 => "тях"
}
}
} ;
ia2e : Str -> Str = -- to be used when the next syllable has vowel different from "à","ú","î" or "ó"
ia2e : Str -> Str = -- to be used when the next syllable has vowel different from "а","ъ","о" or "у"
\s -> case s of {
x@(_*+_) + "ÿ" + y@(("á"|"â"|"ã"|"ä"|"æ"|"ç"|"ê"|"ë"|"ì"|"í"|"ï"|"ð"|"ñ"|"ò"|"ô"|"õ"|"ö"|"÷"|"ø")*)
=> x+"å"+y;
x@(_*+_) + "я" + y@(("б"|"в"|"г"|"д"|"ж"|"з"|"к"|"л"|"м"|"н"|"п"|"р"|"с"|"т"|"ф"|"х"|"ц"|"ч"|"ш")*)
=> x+"е"+y;
_ => s
};
@@ -478,19 +478,19 @@ resource ResBul = ParamX ** open Prelude, Predef in {
\base ->
let base0 : Str
= case base of {
x+"è" => x;
x+"и" => x;
x => x
}
in table {
ASg Masc Indef => base ;
ASg Masc Def => (base0+"èÿ") ;
ASgMascDefNom => (base0+"èÿò") ;
ASg Fem Indef => (base0+"à") ;
ASg Fem Def => (base0+"àòà") ;
ASg Neut Indef => (base0+"î") ;
ASg Neut Def => (base0+"îòî") ;
APl Indef => (ia2e base0+"è") ;
APl Def => (ia2e base0+"èòå")
ASg Masc Def => (base0+"ия") ;
ASgMascDefNom => (base0+"ият") ;
ASg Fem Indef => (base0+"а") ;
ASg Fem Def => (base0+"ата") ;
ASg Neut Indef => (base0+"о") ;
ASg Neut Def => (base0+"ото") ;
APl Indef => (ia2e base0+"и") ;
APl Def => (ia2e base0+"ите")
};
-- For $Sentence$.
@@ -545,37 +545,37 @@ resource ResBul = ParamX ** open Prelude, Predef in {
_ => auxPres++s++clitic.s
} ;
li0 = case <verb.ad.isEmpty,q0> of {<False,True> => "ëè"; _ => []} ;
li0 = case <verb.ad.isEmpty,q0> of {<False,True> => "ли"; _ => []} ;
q = case verb.ad.isEmpty of {True => q0; False => False} ;
li = case q of {True => "ëè"; _ => []} ;
li = case q of {True => "ли"; _ => []} ;
vf1 : Str -> {s1 : Str; s2 : Str} = \s ->
case p of {
Pos => case q of {True => {s1=[]; s2="ëè"++apc []};
Pos => case q of {True => {s1=[]; s2="ли"++apc []};
False => {s1=apc []; s2=[]}} ;
Neg => {s1="íå"++apc li; s2=[]}
Neg => {s1="не"++apc li; s2=[]}
} ;
vf2 : Str -> {s1 : Str; s2 : Str} = \s ->
case p of {
Pos => case q of {True => {s1=[]; s2="ëè"++s};
Pos => case q of {True => {s1=[]; s2="ли"++s};
False => {s1=s; s2=[]}} ;
Neg => case verb.vtype of
{VNormal => {s1="íå"++s; s2=li} ;
_ => {s1="íå"++s++li; s2=[]}}
{VNormal => {s1="не"++s; s2=li} ;
_ => {s1="не"++s++li; s2=[]}}
} ;
vf3 : Str -> {s1 : Str; s2 : Str} = \s ->
case p of {
Pos => {s1="ùå"++s; s2=li} ;
Neg => {s1="íÿìà"++li++"äà"++s; s2=[]}
Pos => {s1="ще"++s; s2=li} ;
Neg => {s1="няма"++li++"да"++s; s2=[]}
} ;
vf4 : Str -> {s1 : Str; s2 : Str} = \s ->
case p of {
Pos => {s1= s++li++clitic.s; s2=[]} ;
Neg => {s1="íå"++s++li++clitic.s; s2=[]}
Neg => {s1="не"++s++li++clitic.s; s2=[]}
} ;
verbs : {aux:{s1:Str; s2:Str}; main:Str} =
@@ -600,8 +600,8 @@ resource ResBul = ParamX ** open Prelude, Predef in {
VPhrasal Dat => {s=personalClitics agr ! Dat++vp.clitics; agr={gn=GSg Neut; p=P3}} ;
VPhrasal c => {s=vp.clitics++personalClitics agr ! c; agr={gn=GSg Neut; p=P3}}
} ;
pol = case p of {Pos => ""; Neg => "íå"}
in vp.ad.s ++ "äà" ++ pol ++ clitic.s ++
pol = case p of {Pos => ""; Neg => "не"}
in vp.ad.s ++ "да" ++ pol ++ clitic.s ++
case a of {
Simul => vp.s ! asp ! VPres (numGenNum clitic.agr.gn) clitic.agr.p ;
Anter => auxBe ! VPres (numGenNum clitic.agr.gn) clitic.agr.p ++
@@ -629,10 +629,10 @@ resource ResBul = ParamX ** open Prelude, Predef in {
linCase : Case -> Polarity -> Str =
\c,p -> case c of {
Acc => "" ;
Dat => "íà" ;
Dat => "на" ;
WithPrep => case p of {
Pos => with_Word ;
Neg => "áåç"
Neg => "без"
} ;
CPrep => ""
} ;
@@ -656,17 +656,17 @@ resource ResBul = ParamX ** open Prelude, Predef in {
{s = table {
unit => mkCardOrd dva dvama dve vtori ;
teen nf => case nf of {
Formal => mkCardOrd (dva+"íàäåñåò") (dva+"íàäåñåòèìà") (dva+"íàäåñåò") (dva+"íàäåñåòè") ;
Informal => mkCardOrd (dva+"íàéñåò") (dva+"íàéñåò") (dva+"íàéñåò") (dva+"íàéñòè")
Formal => mkCardOrd (dva+"надесет") (dva+"надесетима") (dva+"надесет") (dva+"надесети") ;
Informal => mkCardOrd (dva+"найсет") (dva+"найсет") (dva+"найсет") (dva+"найсти")
} ;
ten nf => case nf of {
Formal => mkCardOrd (dva+"äåñåò") (dva+"äåñåòèìà") (dva+"äåñåò") (dva+"äåñåòè") ;
Informal => mkCardOrd dvaiset dvaiset dvaiset (dvaiset+"è")
Formal => mkCardOrd (dva+"десет") (dva+"десетима") (dva+"десет") (dva+"десети") ;
Informal => mkCardOrd dvaiset dvaiset dvaiset (dvaiset+"и")
} ;
hundred => let dvesten : Str
= case dvesta of {
dvest+"à" => dvest+"åí" ;
chetiristot+"èí" => chetiristot+"åí"
dvest+"а" => dvest+"ен" ;
chetiristot+"ин" => chetiristot+"ен"
}
in mkCardOrd100 dvesta dvestata dvesten
}
@@ -676,19 +676,19 @@ resource ResBul = ParamX ** open Prelude, Predef in {
\dva, dvama, dve, vtori ->
table {
NCard dg => digitGenderSpecies dva dvama dve ! dg ;
NOrd aform => let vtora : Str = case vtori of {_+"â" => vtori; _ => init vtori} + "à" ;
vtoro : Str = case vtori of {_+"â" => vtori; _ => init vtori} + "î";
i : Str = case vtori of {_+"â" => "è"; _ => ""}
NOrd aform => let vtora : Str = case vtori of {_+"в" => vtori; _ => init vtori} + "а" ;
vtoro : Str = case vtori of {_+"в" => vtori; _ => init vtori} + "о";
i : Str = case vtori of {_+"в" => "и"; _ => ""}
in case aform of {
ASg Masc Indef => vtori ;
ASg Masc Def => vtori+i+"ÿ" ;
ASgMascDefNom => vtori+i+"ÿò" ;
ASg Masc Def => vtori+i+"я" ;
ASgMascDefNom => vtori+i+"ят" ;
ASg Fem Indef => vtora ;
ASg Fem Def => vtora+"òà" ;
ASg Fem Def => vtora+"та" ;
ASg Neut Indef => vtoro ;
ASg Neut Def => vtoro+"òî" ;
ASg Neut Def => vtoro+"то" ;
APl Indef => vtori+i ;
APl Def => vtori+i+"òå"
APl Def => vtori+i+"те"
}
} ;
@@ -705,14 +705,14 @@ resource ResBul = ParamX ** open Prelude, Predef in {
NOrd aform => let stotn = init (init stoten) + last stoten ;
in case aform of {
ASg Masc Indef => stoten ;
ASg Masc Def => stotn+"èÿ" ;
ASgMascDefNom => stotn+"èÿò" ;
ASg Fem Indef => stotn+"à" ;
ASg Fem Def => stotn+"àòà" ;
ASg Neut Indef => stotn+"î" ;
ASg Neut Def => stotn+"îòî" ;
APl Indef => stotn+"è" ;
APl Def => stotn+"èòå"
ASg Masc Def => stotn+"ия" ;
ASgMascDefNom => stotn+"ият" ;
ASg Fem Indef => stotn+"а" ;
ASg Fem Def => stotn+"ата" ;
ASg Neut Indef => stotn+"о" ;
ASg Neut Def => stotn+"ото" ;
APl Indef => stotn+"и" ;
APl Def => stotn+"ите"
}
} ;
@@ -720,12 +720,12 @@ resource ResBul = ParamX ** open Prelude, Predef in {
\dva, dvama, dve
-> let addDef : Str -> Gender -> Str =
\s,g -> case s of {
dves+"òà" => dves+"òàòå" ;
dv+"à" => dv+"àòà" ;
"0" => s+"òà" ;
"1" => s+case g of {Masc => "ÿò"; Fem => "òà"; Neut => "òî"} ;
"2" => s+case g of {Masc => "òà"; _ => "òå"} ;
x => x+"òå"
dves+"та" => dves+"тате" ;
dv+"а" => dv+"ата" ;
"0" => s+"та" ;
"1" => s+case g of {Masc => "ят"; Fem => "та"; Neut => "то"} ;
"2" => s+case g of {Masc => "та"; _ => "те"} ;
x => x+"те"
}
in table {
CFMasc Indef NonHuman => dva ;
@@ -743,19 +743,19 @@ resource ResBul = ParamX ** open Prelude, Predef in {
mkIP : Str -> Str -> GenNum -> {s : Role => QForm => Str ; gn : GenNum} =
\koi,kogo,gn -> {
s = table {
RSubj => table QForm [koi; koi+"òî"] ;
RObj Acc => table QForm [kogo; kogo+"òî"] ;
RObj Dat => table QForm ["íà" ++ kogo; "íà" ++ kogo+"òî"] ;
RObj WithPrep => table QForm [with_Word ++ kogo; with_Word ++ kogo+"òî"] ;
RObj CPrep => table QForm [kogo; kogo+"òî"] ;
RVoc => table QForm [koi; koi+"òî"]
RSubj => table QForm [koi; koi+"то"] ;
RObj Acc => table QForm [kogo; kogo+"то"] ;
RObj Dat => table QForm ["на" ++ kogo; "на" ++ kogo+"то"] ;
RObj WithPrep => table QForm [with_Word ++ kogo; with_Word ++ kogo+"то"] ;
RObj CPrep => table QForm [kogo; kogo+"то"] ;
RVoc => table QForm [koi; koi+"то"]
} ;
gn = gn
} ;
with_Word : Str
= pre { "ñ" ;
"ñúñ" / strs {"ñ" ; "ç" ; "Ñ" ; "Ç"}
= pre { "с" ;
"със" / strs {"с" ; "з" ; "С" ; "З"}
} ;
mkPron : (az,moj,moia,moiat,moia_,moiata,moe,moeto,moi,moite : Str) ->
@@ -812,43 +812,43 @@ resource ResBul = ParamX ** open Prelude, Predef in {
whichRP : GenNum => Str
= table {
GSg Masc => "êîéòî" ;
GSg Fem => "êîÿòî" ;
GSg Neut => "êîåòî" ;
GPl => "êîèòî"
GSg Masc => "който" ;
GSg Fem => "която" ;
GSg Neut => "което" ;
GPl => "които"
} ;
suchRP : GenNum => Str
= table {
GSg Masc => "òàêúâ" ;
GSg Fem => "òàêàâà" ;
GSg Neut => "òàêîâà" ;
GPl => "òàêèâà"
GSg Masc => "такъв" ;
GSg Fem => "такава" ;
GSg Neut => "такова" ;
GPl => "такива"
} ;
thisRP : GenNum => Str
= table {
GSg Masc => "òîçè" ;
GSg Fem => "òaçè" ;
GSg Neut => "òîâà" ;
GPl => "òåçè"
GSg Masc => "този" ;
GSg Fem => "тaзи" ;
GSg Neut => "това" ;
GPl => "тези"
} ;
linCoord : Str -> Ints 4 => Str ;
linCoord comma = table {0 => "è"; 1=>"èëè"; 2=>"íèòî"; 3=>comma; 4=>[]} ;
linCoord comma = table {0 => "и"; 1=>"или"; 2=>"нито"; 3=>comma; 4=>[]} ;
hyphen : Str = SOFT_BIND ++ "-" ++ SOFT_BIND ;
reflPron : AForm => Str =
table {
ASg Masc Indef => "ñâîé" ;
ASg Masc Def => "ñâîÿ" ;
ASgMascDefNom => "ñâîÿò" ;
ASg Fem Indef => "ñâîÿ" ;
ASg Fem Def => "ñâîÿòà" ;
ASg Neut Indef => "ñâîå" ;
ASg Neut Def => "ñâîåòî" ;
APl Indef => "ñâîè" ;
APl Def => "ñâîèòå"
ASg Masc Indef => "свой" ;
ASg Masc Def => "своя" ;
ASgMascDefNom => "своят" ;
ASg Fem Indef => "своя" ;
ASg Fem Def => "своята" ;
ASg Neut Indef => "свое" ;
ASg Neut Def => "своето" ;
APl Indef => "свои" ;
APl Def => "своите"
} ;
}