Romanian numerals in utf8

This commit is contained in:
aarne
2010-03-22 08:35:05 +00:00
parent 534d553f3e
commit 2e78c2f774

View File

@@ -1,6 +1,8 @@
concrete NumeralRon of Numeral = CatRon ** concrete NumeralRon of Numeral = CatRon **
open MorphoRon, CatRon, Prelude in { open MorphoRon, CatRon, Prelude in {
flags coding = utf8 ;
param DForm = unit | teen | ten | teen_inf ; param DForm = unit | teen | ten | teen_inf ;
param Place = indep | attr ; param Place = indep | attr ;
@@ -20,7 +22,7 @@ oper mkOrdinalForm : Str -> Gender -> Str =
_ => two+"lea" _ => two+"lea"
}; };
Fem => case two of Fem => case two of
{ x + ("ã"|"u") => x +"a"; { x + ("ă"|"u") => x +"a";
x + "ei" => two + "a"; x + "ei" => two + "a";
x + "ii" => x + "ia" ; x + "ii" => x + "ia" ;
x + "i" => x + "ea"; x + "i" => x + "ea";
@@ -72,7 +74,7 @@ oper mkNumVSpc : Str -> Str -> Str -> Str -> Str -> Str -> Str -> Str -> Str ->
} ; } ;
oper regNum : Str -> Digit = oper regNum : Str -> Digit =
\trei -> mkNum trei (trei + "sprezece") (trei + "zeci") (trei + "ºpe") ; \trei -> mkNum trei (trei + "sprezece") (trei + "zeci") (trei + "şpe") ;
oper mkMidF : Str -> Str -> Sub100 = oper mkMidF : Str -> Str -> Sub100 =
@@ -111,17 +113,17 @@ lin num = \d ->
} ; } ;
-- Latin A Supplement chars -- Latin A Supplement chars
lin n2 = mkNumVSpc "doi" "doispreze" "douãsprezece" "douãzeci" "douã" "doiºpe" "douãºpe" "doilea" "doua"; lin n2 = mkNumVSpc "doi" "doispreze" "douăsprezece" "douăzeci" "două" "doişpe" "douăşpe" "doilea" "doua";
lin n3 = regNum "trei"; lin n3 = regNum "trei";
lin n4 = mkNum "patru" "paisprezece" "patruzeci" "paiºpe"; lin n4 = mkNum "patru" "paisprezece" "patruzeci" "paişpe";
lin n5 = mkNum "cinci" "cinsprezece" "cincizeci" "cinºpe"; lin n5 = mkNum "cinci" "cinsprezece" "cincizeci" "cinşpe";
lin n6 = mkNum "ºase" "ºaisprezece" "ºaizeci" "ºaiºpe"; lin n6 = mkNum "şase" "şaisprezece" "şaizeci" "şaişpe";
lin n7 = mkNum "ºapte" "ºaptesprezece" "ºaptezeci" "ºaptispe"; lin n7 = mkNum "şapte" "şaptesprezece" "şaptezeci" "şaptispe";
lin n8 = mkNum "opt" "optsprezece" "optzeci" "optiºpe"; lin n8 = mkNum "opt" "optsprezece" "optzeci" "optişpe";
lin n9 = regNum "nouã"; lin n9 = regNum "nouă";
lin pot01 = let num = mkNumVSpc "un" "unsprezece" "unsprezece" "zece" "o" "unºpe" "unºpe" "dintâi" "dintâi" ; lin pot01 = let num = mkNumVSpc "un" "unsprezece" "unsprezece" "zece" "o" "unşpe" "unşpe" "dintâi" "dintâi" ;
dep = mkNumVSpc "unu" "unsprezece" "unsprezece" "zece" "una" "unºpe" "unºpe" "unulea" "una" dep = mkNumVSpc "unu" "unsprezece" "unsprezece" "zece" "una" "unşpe" "unşpe" "unulea" "una"
in in
{ s = \\o,c => table {indep => num.s ! o ! c ; { s = \\o,c => table {indep => num.s ! o ! c ;
@@ -136,7 +138,7 @@ lin pot0 d = { s = \\o, c => \\_ => d.s ! o ! c ;
lin pot110 = mkMidF "zece" "zece" ; lin pot110 = mkMidF "zece" "zece" ;
lin pot111 = mkMidF "unsprezece" "unºpe" ; lin pot111 = mkMidF "unsprezece" "unşpe" ;
lin pot1to19 = \d -> lin pot1to19 = \d ->
{s = \\c => table { Formal => \\_ => d.s ! c ! teen ; {s = \\c => table { Formal => \\_ => d.s ! c ! teen ;
@@ -159,8 +161,8 @@ lin pot1 = \d ->
lin pot1plus d e = lin pot1plus d e =
{s = table { {s = table {
NCard g => \\_,_ => d.s ! (NCard g) ! ten ++ "ºi" ++ e.s ! (NCard g) ! unit ! attr ; NCard g => \\_,_ => d.s ! (NCard g) ! ten ++ "şi" ++ e.s ! (NCard g) ! unit ! attr ;
NOrd g => \\_,_ => d.s ! (NCard g) ! ten ++ "ºi" ++ e.s ! (NOrd g) ! unit ! attr NOrd g => \\_,_ => d.s ! (NCard g) ! ten ++ "şi" ++ e.s ! (NOrd g) ! unit ! attr
}; };
size = pl size = pl
}; };
@@ -195,9 +197,9 @@ lin pot3plus n m =
size = pl size = pl
}; };
oper mksute : Size -> Str = \sz -> table {sg => "sutã" ; _ => "sute" } ! sz ; oper mksute : Size -> Str = \sz -> table {sg => "sută" ; _ => "sute" } ! sz ;
oper mkSute : Size -> Gender -> Str = \sz, g -> oper mkSute : Size -> Gender -> Str = \sz, g ->
table {sg => mkOrdinalForm "sutã" g ; table {sg => mkOrdinalForm "sută" g ;
_ => mkOrdinalForm "sute" g } ! sz ; _ => mkOrdinalForm "sute" g } ! sz ;
oper mkmie : Size -> Str -> Str = \sz, attr -> oper mkmie : Size -> Str -> Str = \sz, attr ->