summaryrefslogtreecommitdiff
path: root/next-lib/src/thai/NumeralTha.gf
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2008-12-18 14:21:28 +0000
committeraarne <aarne@cs.chalmers.se>2008-12-18 14:21:28 +0000
commit9e341cc7f9020eda842c8ad0f1f57bf6326eb89d (patch)
tree1c0e78a1c3790286a0fabf408ea15ee179f8749d /next-lib/src/thai/NumeralTha.gf
parent98a4b6a8088273dfa55dfa1c3ea78e85cd9c7a8d (diff)
Hindi and Thai compile in 1.5
Diffstat (limited to 'next-lib/src/thai/NumeralTha.gf')
-rw-r--r--next-lib/src/thai/NumeralTha.gf66
1 files changed, 66 insertions, 0 deletions
diff --git a/next-lib/src/thai/NumeralTha.gf b/next-lib/src/thai/NumeralTha.gf
new file mode 100644
index 000000000..80c1e3788
--- /dev/null
+++ b/next-lib/src/thai/NumeralTha.gf
@@ -0,0 +1,66 @@
+concrete NumeralTha of Numeral = CatTha ** open ResTha, StringsTha in {
+
+lincat
+-- Numeral = {s : Str} ;
+ Digit = {s : DForm => Str} ;
+ Sub10 = {s : DForm => Str} ;
+ Sub100 = {s : NForm => Str} ;
+ Sub1000 = {s : NForm => Str} ;
+ Sub1000000 = {s : Str} ;
+
+lin
+ num x = x ;
+
+ pot01 = mkNum nvg_s nvg_s et_s ;
+
+ n2 = mkNum soog_s yii_s soog_s ;
+ n3 = regNum saam_s ;
+ n4 = regNum sii_s ;
+ n5 = regNum haa_s ;
+ n6 = regNum hok_s ;
+ n7 = regNum cet_s ;
+ n8 = regNum peet_s ;
+ n9 = regNum kaaw_s ;
+
+
+ pot0 d = d ;
+
+ pot110 = {s = sip} ;
+ pot111 = {s = table {
+ Unit => sip_s ++ et_s ;
+ Thousand => nvg_s ++ mvvn_s ++ nvg_s ++ phan_s
+ }
+ } ;
+ pot1to19 d = {s = table {
+ Unit => sip_s ++ d.s ! After ;
+ Thousand => nvg_s ++ mvvn_s ++ d.s ! Indep ++ phan_s
+ }
+ } ;
+ pot0as1 d = {s = \\n => d.s ! Indep ++ phan ! n} ;
+ pot1 d = {s = \\n => d.s ! ModTen ++ sip ! n} ;
+ pot1plus d e = {
+ s = \\n => d.s ! ModTen ++ sip ! n ++ e.s ! After ++ phan ! n
+ } ;
+ pot1as2 n = n ;
+ pot2 d = {s = \\n => d.s ! Indep ++ roy ! n} ;
+ pot2plus d e = {s = \\n => d.s ! Indep ++ roy ! n ++ e.s ! n} ;
+ pot2as3 n = {s = n.s ! Unit} ;
+ pot3 n = {s = n.s ! Thousand} ;
+ pot3plus n m = {s = n.s ! Thousand ++ m.s ! Unit} ;
+
+param
+ DForm = Indep | ModTen | After ;
+ NForm = Unit | Thousand ;
+
+oper
+ mkNum : Str -> Str -> Str -> {s : DForm => Str} = \x,y,z ->
+ {s = table {Indep => x ; ModTen => y ; After => z}} ;
+ regNum : Str -> {s : DForm => Str} = \x ->
+ mkNum x x x ;
+
+
+ sip = table {Unit => sip_s ; Thousand => mvvn_s} ;
+ roy = table {Unit => rooy_s ; Thousand => seen_s} ;
+ phan = table {Unit => [] ; Thousand => phan_s} ;
+
+}