summaryrefslogtreecommitdiff
path: root/examples/numerals/romanian.gf
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2008-08-04 18:26:48 +0000
committeraarne <aarne@cs.chalmers.se>2008-08-04 18:26:48 +0000
commita9893f45724299e6cc773bbb2fa2cf315fe85206 (patch)
treeb5c6222b2422a3db7bf4dd676aa4872adf22daf4 /examples/numerals/romanian.gf
parenta401820e3718a936cc926c457d29ec145e189be5 (diff)
ported numerals to GF3 and encoded in UTF8; some problematic ones in todo
Diffstat (limited to 'examples/numerals/romanian.gf')
-rw-r--r--examples/numerals/romanian.gf70
1 files changed, 70 insertions, 0 deletions
diff --git a/examples/numerals/romanian.gf b/examples/numerals/romanian.gf
new file mode 100644
index 000000000..4dfaaceac
--- /dev/null
+++ b/examples/numerals/romanian.gf
@@ -0,0 +1,70 @@
+concrete romanian of Numerals = {
+flags coding = utf8 ;
+-- include numerals.Abs.gf ;
+-- flags coding=latinasupplement ;
+
+-- Note [s,], [a%] for Romanian s, and a with up bow ontop (not â)
+
+param DForm = unit | teen | ten | attr ;
+param MidForm = indep | det ;
+param Size = sg | less20 | pl ;
+
+lincat Numeral = { s : Str } ;
+oper LinDigit = {s : DForm => Str ; size : Size} ;
+lincat Digit = LinDigit ;
+
+lincat Sub10 = {s : DForm => Str ; size : Size} ;
+lincat Sub100 = {s : MidForm => Str ; size : Size} ;
+lincat Sub1000 = {s : MidForm => Str ; size : Size} ;
+lincat Sub1000000 = { s : Str } ;
+
+oper mkNum : Str -> Str -> Str -> LinDigit =
+ \two -> \twelve -> \twenty -> mkNumSpc two twelve twenty two ;
+
+oper mkNumSpc : Str -> Str -> Str -> Str -> LinDigit =
+ \two -> \twelve -> \twenty -> \doua ->
+ {s = table {unit => two ; teen => twelve ; ten => twenty ; attr => doua} ; size = less20} ;
+
+oper regNum : Str -> LinDigit =
+ \trei -> mkNum trei (trei + variants { "sprezece" ; "şpe" }) (trei + "zeci") ;
+
+oper ss : Str -> {s : MidForm => Str ; size : Size} = \st -> {s = table {_ => st} ; size = less20} ;
+
+lin num x = {s = [] ++ x.s ++ [] }; -- Latin A Supplement chars
+lin n2 = mkNumSpc "doi" (variants { "doisprezece" ; "douăsprezece" }) "douăzeci" "două" ;
+lin n3 = regNum "trei" ;
+lin n4 = mkNum "patru" (variants{"paisprezece" ; "paişpe"}) "patruzeci" ;
+lin n5 = mkNumSpc "cinci" (variants{"cinsprezece" ; "cinşpe"}) "cinzeci" (variants { "cinci" ; "cin" });
+lin n6 = mkNum "şase" (variants{"şaisprezece" ; "şaispe"}) "şaizeci" ;
+lin n7 = mkNum "şapte" (variants{"şaptesprezece" ; "şapspe"}) "şaptezeci" ;
+lin n8 = mkNum "opt" (variants{"optsprezece" ; "opspe"}) "optzeci" ;
+lin n9 = regNum "nouă" ;
+
+lin pot01 = {s = table {attr => "o" ; f => "unu"} ; size = sg} ;
+lin pot0 d = d ;
+lin pot110 = ss "zece" ;
+lin pot111 = ss (variants { "unsprezece" ; "unşpe"}) ;
+lin pot1to19 d = {s = table {_ => d.s ! teen } ; size = less20} ;
+lin pot0as1 n = {s = table {indep => n.s ! unit ; det => n.s ! attr } ; size = n.size} ;
+lin pot1 d = {s = table {_ => d.s ! ten } ; size = pl} ;
+lin pot1plus d e =
+ {s = table {indep => d.s ! ten ++ "şi" ++ e.s ! unit ;
+ det => d.s ! ten ++ "şi" ++ e.s ! attr } ;
+ size = pl} ;
+lin pot1as2 n = n ;
+lin pot2 d = {s = table {_ => d.s ! attr ++ (mksute d.size) }; size = pl} ;
+lin pot2plus d e =
+ {s = table {indep => d.s ! attr ++ (mksute d.size) ++ e.s ! indep;
+ det => d.s ! attr ++ (mksute d.size) ++ e.s ! det };
+ size = pl} ;
+lin pot2as3 n = {s = n.s ! indep };
+lin pot3 n = {s = (mkmie n.size (n.s ! det) (n.s ! indep))} ;
+lin pot3plus n m = {s = (mkmie n.size (n.s ! det) (n.s ! indep)) ++ m.s ! indep} ;
+
+oper mksute : Size -> Str = \sz -> table {sg => "suta" ; _ => "sute" } ! sz ;
+oper mkmie : Size -> Str -> Str -> Str = \sz -> \attr -> \indep ->
+ table {sg => "o" ++ "mie" ;
+ less20 => attr ++ "mii" ;
+ pl => indep ++ "de" ++ "mii"} ! sz ;
+
+}