summaryrefslogtreecommitdiff
path: root/examples/numerals/guahibo.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/guahibo.gf
parenta401820e3718a936cc926c457d29ec145e189be5 (diff)
ported numerals to GF3 and encoded in UTF8; some problematic ones in todo
Diffstat (limited to 'examples/numerals/guahibo.gf')
-rw-r--r--examples/numerals/guahibo.gf50
1 files changed, 50 insertions, 0 deletions
diff --git a/examples/numerals/guahibo.gf b/examples/numerals/guahibo.gf
new file mode 100644
index 000000000..a345069e4
--- /dev/null
+++ b/examples/numerals/guahibo.gf
@@ -0,0 +1,50 @@
+concrete guahibo of Numerals = {
+-- include numerals.Abs.gf ;
+
+oper bind : Str -> Str -> Str = \a -> \b -> a ++ b ;
+
+param Size = sg | pl ;
+
+oper All = {s : Str ; size : Size};
+
+lincat Numeral = { s : Str } ;
+lincat Digit = All ;
+lincat Sub10 = All ;
+lincat Sub100 = All ;
+lincat Sub1000 = All ;
+lincat Sub1000000 = { s : Str } ;
+
+oper mkNum : Str -> All = \tri ->
+ { s = tri ; size = pl};
+
+lin num x = {s = x.s } ;
+
+lin n2 = mkNum "aniha" ;
+lin n3 = mkNum "akueya" ;
+lin n4 = mkNum "yana" ;
+lin n5 = mkNum "kobe" ;
+lin n6 = mkNum "ku" ;
+lin n7 = mkNum "iwi" ;
+lin n8 = mkNum "yu" ;
+lin n9 = mkNum "ho" ;
+
+oper ss : Str -> All = \s1 -> {s = s1 ; size = pl } ;
+
+lin pot01 = { s = "kae" ; size = sg};
+lin pot0 d = d ;
+lin pot110 = ss "xu" ;
+lin pot111 = ss ("xu" + "kae") ;
+lin pot1to19 d = ss (bind "xu" d.s) ;
+lin pot0as1 n = n ;
+lin pot1 d = ss (bind d.s "bae" );
+lin pot1plus d e = ss ((bind d.s "bae") ++ e.s ) ;
+lin pot1as2 n = n ;
+lin pot2 d = ss (bind ((selsg d.s) ! d.size) "sia" ) ;
+lin pot2plus d e = ss ((bind ((selsg d.s) ! d.size) "sia") ++ e.s) ;
+lin pot2as3 n = {s = n.s };
+lin pot3 n = {s = bind ((selsg n.s) ! n.size) "sunu" } ;
+lin pot3plus n m = {s = (bind ((selsg n.s) ! n.size) "sunu") ++ m.s} ;
+
+oper selsg : Str -> Size => Str = \s -> table {sg => [] ; pl => s } ;
+
+}