summaryrefslogtreecommitdiff
path: root/examples/numerals/kambera.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/kambera.gf
parenta401820e3718a936cc926c457d29ec145e189be5 (diff)
ported numerals to GF3 and encoded in UTF8; some problematic ones in todo
Diffstat (limited to 'examples/numerals/kambera.gf')
-rw-r--r--examples/numerals/kambera.gf52
1 files changed, 52 insertions, 0 deletions
diff --git a/examples/numerals/kambera.gf b/examples/numerals/kambera.gf
new file mode 100644
index 000000000..e2173143a
--- /dev/null
+++ b/examples/numerals/kambera.gf
@@ -0,0 +1,52 @@
+concrete kambera of Numerals = {
+-- include numerals.Abs.gf ;
+
+param Size = sg | two | pl ;
+
+oper Form = {s : Str ; size : Size} ;
+
+lincat Numeral = { s : Str } ;
+lincat Digit = Form ;
+lincat Sub10 = Form ;
+lincat Sub100 = Form ;
+lincat Sub1000 = Form ;
+lincat Sub1000000 = { s : Str } ;
+
+oper mkNum : Str -> Form = \two ->
+ {s = two ; size = pl} ;
+
+lin num x = x ;
+-- lin n1 mkNum "diha" ;
+lin n2 = {s = "dua" ; size = two} ;
+lin n3 = mkNum "tailu" ;
+lin n4 = mkNum "patu" ;
+lin n5 = mkNum "lima" ;
+lin n6 = mkNum "nomu" ;
+lin n7 = mkNum "pitu" ;
+lin n8 = mkNum "walu" ;
+lin n9 = mkNum "hiwa" ;
+
+oper ss : Str -> {s : Str ; size : Size} = \s1 -> {s = s1 ; size = pl} ;
+
+lin pot01 = {s = "diha" ; size = sg} ;
+lin pot0 d = d ;
+lin pot110 = ss "hakambulu" ;
+lin pot111 = ss ("hakambulu" ++ "hau") ;
+lin pot1to19 d = ss ("hakambulu" ++ (if12 d.size d.s)) ;
+lin pot0as1 n = n ;
+lin pot1 d = ss (d.s ++ "kambulu" ) ;
+lin pot1plus d e = ss (d.s ++ "kambulu" ++ (if12 e.size e.s)) ;
+lin pot1as2 n = n ;
+lin pot2 d = ss (selsg d.size "hangahu" (d.s ++ "ngahu")) ;
+lin pot2plus d e = ss (selsg d.size "hangahu" (d.s ++ "ngahu") ++ e.s) ;
+lin pot2as3 n = {s = n.s };
+lin pot3 n = {s = (selsg n.size "hariu" (n.s ++ "riu"))} ;
+lin pot3plus n m = {s = (selsg n.size "hariu" (n.s ++ "riu")) ++ m.s } ;
+
+oper if12 : Size -> Str -> Str = \sz -> \a ->
+ table {sg => "hau" ; two => "dambu" ; _ => a} ! sz ;
+oper selsg : Size -> Str -> Str -> Str = \sz -> \a -> \b ->
+ table {sg => a ; _ => b} ! sz ;
+
+
+}