summaryrefslogtreecommitdiff
path: root/examples/numerals/maltese.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/maltese.gf
parenta401820e3718a936cc926c457d29ec145e189be5 (diff)
ported numerals to GF3 and encoded in UTF8; some problematic ones in todo
Diffstat (limited to 'examples/numerals/maltese.gf')
-rw-r--r--examples/numerals/maltese.gf62
1 files changed, 62 insertions, 0 deletions
diff --git a/examples/numerals/maltese.gf b/examples/numerals/maltese.gf
new file mode 100644
index 000000000..481d9b870
--- /dev/null
+++ b/examples/numerals/maltese.gf
@@ -0,0 +1,62 @@
+concrete maltese of Numerals = {
+-- include numerals.Abs.gf ;
+
+param DForm = unit | teen | teenil | ten | hund ;
+param Size = sg | pl | dual ;
+
+oper LinDigit = {s: DForm => Str ; s2 : Str ; size : Size } ;
+oper Form = {s : Str ; s2 : Str ; size : Size } ;
+
+lincat Numeral = {s : Str} ;
+lincat Digit = LinDigit ;
+lincat Sub10 = LinDigit ;
+lincat Sub100 = Form ;
+lincat Sub1000 = Form ;
+lincat Sub1000000 = {s : Str} ;
+
+lin num x = x ; -- TODO
+
+oper mkN : Str -> Str -> Str -> Str -> Str -> LinDigit = \u -> \tn -> \t -> \h -> \e ->
+ {s = table {unit => u ; teen => tn + "ax" ; teenil => tn + "ax" + "il" ;
+ ten => t ; hund => h ++ "mija"} ; s2 = e ; size = pl };
+
+lin n2 =
+ {s = table {unit => "tnejn" ;
+ teen => "tnax" ; teenil => "tnax-il" ;
+ ten => "gh-oxrin" ;
+ hund => "mitejn"} ; s2 = "tnejn" ; size = dual} ;
+lin n3 = mkN "tlieta" "tlett" "tletin" "tliet" "tlitt";
+lin n4 = mkN "erbgh-a" "erbat" "erbgh-in" "erba'" "erbat";
+lin n5 = mkN "h-amsa" "h-mist" "h-amsin" "h-ames" "h-amest" ;
+lin n6 = mkN "sitta" "sitt" "sitt" "sitt" "sitt";
+lin n7 = mkN "sebgh-a" "sbat" "sbebgh-in" "seba'" "sebat" ;
+lin n8 = mkN "tmienja" "tmint" "tmenin" "tmien" "tmint" ;
+lin n9 = mkN "disgh-a" "dsat" "disgh-in" "disa'" "disat";
+
+oper ss : Str -> Form = \s1 -> {s = s1 ; s2 = s1 ; size = pl };
+oper ss2 : Str -> Str -> Form = \a -> \b -> {s = a ; s2 = b ; size = pl };
+
+lin pot01 =
+ {s = table {unit => "wieh-ed" ; teen => "h-dax" ; _ => "mija" } ;
+ s2 = "wieh-ed" ;
+ size = sg};
+lin pot0 d = d;
+lin pot110 = ss "gh-axra" ;
+lin pot111 = ss2 "h-dax" "h-dax-il";
+lin pot1to19 d = ss2 (d.s ! teen) (d.s ! teenil);
+lin pot0as1 n = {s = n.s ! unit ; s2 = n.s2 ; size = n.size} ;
+lin pot1 d = ss (d.s ! ten) ;
+lin pot1plus d e = ss ((e.s ! unit) ++ "u" ++ (d.s ! ten)) ;
+lin pot1as2 n = n ;
+lin pot2 d = ss (d.s ! hund) ;
+lin pot2plus d e = ss2 ((d.s ! hund) ++ "u" ++ e.s)
+ ((d.s ! hund) ++ "u" ++ e.s2) ;
+lin pot2as3 n = {s = n.s } ;
+lin pot3 n = { s = (elf n.s2) ! n.size } ;
+lin pot3plus n m = { s = (elf n.s2) ! n.size ++ m.s} ;
+
+oper elf : Str -> Size => Str = \attr ->
+ table {pl => attr ++ "elef" ; dual => "elfejn" ; sg => "elf"} ;
+
+
+}