diff options
| author | aarne <aarne@cs.chalmers.se> | 2008-08-04 18:26:48 +0000 |
|---|---|---|
| committer | aarne <aarne@cs.chalmers.se> | 2008-08-04 18:26:48 +0000 |
| commit | a9893f45724299e6cc773bbb2fa2cf315fe85206 (patch) | |
| tree | b5c6222b2422a3db7bf4dd676aa4872adf22daf4 /examples/numerals/malay.gf | |
| parent | a401820e3718a936cc926c457d29ec145e189be5 (diff) | |
ported numerals to GF3 and encoded in UTF8; some problematic ones in todo
Diffstat (limited to 'examples/numerals/malay.gf')
| -rw-r--r-- | examples/numerals/malay.gf | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/examples/numerals/malay.gf b/examples/numerals/malay.gf new file mode 100644 index 000000000..1044fc87d --- /dev/null +++ b/examples/numerals/malay.gf @@ -0,0 +1,74 @@ +concrete malay of Numerals = { +-- Malay Numerals (Indonesian) +-- David Wahlstedt Sep 2002 + +-- include numerals.Abs.gf ; + +param + Place = attr | indep ; + Nm = sg | pl ; + +oper Num = {inh : Nm ; s : Place => Str} ; + +lincat + Numeral = {s : Str} ; + Digit = {s : Str} ; + Sub10 = Num ; + Sub100 = Num ; + Sub1000 = Num ; + Sub1000000 = {s : Str} ; + +oper + ratus : Nm => Str = -- 100 + table {{sg} => "seratus" ; {pl} => "ratus"} ; + + ribu : Nm => Str = -- 1000 + table {{sg} => "seribu" ; {pl} => "ribu"} ; + + mkTab : Str -> Place => Str = \s -> table { _ => s } ; + + mkNum : Str -> Num = \s -> {inh = pl ; s = mkTab s} ; + + ss : Str -> { s : Str } = \s -> { s = s } ; + +lin + num x0 = x0 ; + + n2 = ss "dua" ; + n3 = ss "tiga" ; + n4 = ss "empat" ; + n5 = ss "lima" ; + n6 = ss "enam" ; + n7 = ss "tujuh" ; + n8 = ss "delapan" ; + n9 = ss "sembilan" ; + + pot01 = {inh = sg ; s = table {{attr} => [] ; {indep} => "satu"}} ; + + pot0 d = mkNum d.s ; + + pot110 = mkNum "sepuluh" ; + + pot111 = mkNum "sebelas" ; + + pot1to19 d = mkNum ( d.s ++ "belas" ) ; + + pot0as1 n = n ; + + pot1 d = mkNum ( d.s ++ "puluh" ) ; + + pot1plus d e = mkNum ( d.s ++ "puluh" ++ e.s ! indep ) ; + + pot1as2 n = n ; + + pot2 d = mkNum ( d.s ! attr ++ ratus ! d.inh ) ; + + pot2plus d e = mkNum ( d.s ! attr ++ ratus ! d.inh ++ e.s ! indep ) ; + + pot2as3 n = ss ( n.s ! indep ) ; + + pot3 n = ss ( n.s ! attr ++ ribu ! n.inh ) ; + + pot3plus n m = ss ( n.s ! attr ++ ribu ! n.inh ++ m.s ! indep ) ; + +} |
