blob: 669ae958403497d8d3e2e222a333172ca71a026b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
|
-- Tamil
-- Ad hoc transcr.
-- when there is something bigger maybe a:yiram should be preceded
-- by an o:ru
-- c is sh/ch etc
-- s is sanskr. s'
-- S is sanskr. s.
-- G is velar n i.e [ng]
-- V regular n in e.g [na:ru]
-- n one ring n
-- N two ring n
-- ñ
-- l
-- L (like N but without the middle ring)
-- M is retroflex l with the char that looks a bit like m (e.g l in Tamil)
include numerals.Abs.gf ;
flags coding=tamil ;
oper
vowel : Strs = strs {"o" ; "e" ; "a" ; "i" ; "u"} ;
labial : Strs = strs {"m" ; "p"} ;
retroflex : Strs = strs {"N" ; "T"} ;
sandhi_u : Str = pre {"u" ; [] / vowel} ;
sandhi_n : Str = pre {"n" ; "m" / labial} ;
sandhi_spc_n : Str = pre {"n" ; "p" / labial} ;
-- sandhi_N : Str = post {"n" ; "N" / retroflex } ;
param DForm = unit | attr1 | attr2 | teen ;
param Size = sg | four | five | eight | nine | more100 | less100 ;
param Place = attr | indep ;
param Sub1000Data = attrtwo | indeptwo | preceded | lakhs | lakhs2 ;
lincat Numeral = {s : Str} ;
lincat Digit = {s : DForm => Str ; size : Size} ;
lincat Sub10 = {s : DForm => Str ; size : Size} ;
lincat Sub100 = {s : Place => Str ; size : Size} ;
lincat Sub1000 = {s : Sub1000Data => Str ; size : Size} ;
lincat Sub1000000 = {s : Str} ;
lin num x0 =
{s = "/T" ++ x0.s ++ "T/"} ; -- the Tamil environment
lin n2 =
{s = table {teen => "panniraNTu" ;
unit => "iraNT" + sandhi_u ;
attr1 => "iru" ;
attr2 => variants {"iraNT" + sandhi_u ; "i:r"} } ; size = less100} ;
lin n3 =
{s = table {teen => "patin" + "mu:nru" ;
unit => "mu:nr" + sandhi_u ;
attr1 => "mu" + sandhi_spc_n ;
attr2 => "mu:l"} ; size = less100} ;
lin n4 =
{s = table {teen => "pati" + variants { "Va:lu" ; "Va:nku" } ;
unit => variants { "Va:l" + sandhi_u ; "Va:nk" + sandhi_u } ;
attr1 => "Va:r" ;
attr2 => "Va:l"} ; size = four} ;
lin n5 =
{s = table {teen => "patin" + "aindu" ;
unit => "aint" + sandhi_u ;
attr1 => "ai" + sandhi_n ;
attr2 => "aiy"} ; size = five} ;
lin n6 =
{s = table {teen => "patin" + "a:ru" ;
unit => "a:r" + sandhi_u ;
attr1 => "aru" ;
attr2 => "a:r"} ; size = less100} ;
lin n7 =
{s = table {teen => "patin" + "e:Lu" ;
unit => "e:L" + sandhi_u ;
attr1 => "eLu" ;
attr2 => "eL"} ; size = less100} ;
lin n8 =
{s = table {teen => "patin" + "eTTu" ;
unit => "eTT" + sandhi_u ;
attr1 => "eN" ;
attr2 => "eNN"} ; size = eight} ;
lin n9 =
{s = table {teen => "patt" + "o:npatu" ;
unit => "o:npat" + sandhi_u ;
attr1 => "toN" ;
attr2 => "o:npatin"} ; size = nine} ;
oper fiveh : Str = variants { "ainna:ru" ; "añña:ru"} ;
oper fiveh_sandhi : Str = variants { "ainna:r" + sandhi_u ; "añña:r" + sandhi_u } ;
lin pot01 =
{s = table {unit => "o:nru"; teen => "patin" + "o:nru" ; attr1 => "o:r" + sandhi_u ; attr2 => []} ; size = sg} ;
lin pot0 d =
{s = d.s ; size = d.size} ;
lin pot110 =
{s = table {_ => "pattu"} ; size = less100} ;
lin pot111 =
{s = table {_ => "patin" + "o:nr" + sandhi_u} ; size = less100} ;
lin pot1to19 d =
{s = table {_ => d.s ! teen} ; size = less100} ;
lin pot0as1 n =
{s = table {attr => n.s ! attr2 ; indep => n.s ! unit} ; size = n.size} ;
lin pot1 d =
{s = table {_ => table {nine => "toNNa:r" + sandhi_u ; _ => d.s ! attr1 ++ "patu"} ! d.size} ; size = less100} ;
lin pot1plus d e =
{s = table {_ => table {nine => ("toNNa:r" + sandhi_u) ++ e.s ! unit; _ => d.s ! attr1 ++ "pat" + sandhi_u } ! d.size ++ e.s ! unit }; size = less100} ;
lin pot1as2 n =
{s = table {indeptwo => n.s ! indep ; attrtwo => n.s ! attr ; preceded => n.s ! indep ; _ => "dummy"}; size = n.size} ;
lin pot2 d =
{s = table {indeptwo =>
table {nine => "toLLa:yiram" ;
eight => "eNNa:ru" ;
four => "Va:Va:ru" ;
five => fiveh ;
sg => "Va:ru" ;
_ => d.s ! attr1 ++ "Va:ru"} ! d.size ;
attrtwo =>
table {nine => "toLLa:yiratt" + sandhi_u ;
eight => "eNNa:r" + sandhi_u ;
four => "Va:Va:r" + sandhi_u;
five => fiveh_sandhi ;
_ => d.s ! attr1 ++ "Va:r" + sandhi_u} ! d.size ;
preceded =>
table {nine => "toLLa:yiram" ;
eight => "eNNa:ru" ;
four => "Va:Va:ru" ;
five => fiveh ;
_ => d.s ! attr1 ++ "Va:ru"} ! d.size ;
lakhs => d.s ! unit ++ "ilaTcam" ;
lakhs2 => d.s ! unit ++ "ilaTcattu" } ;
size = more100} ;
lin pot2plus d e =
{s = table {indeptwo =>
table {nine => ("toLLa:yiratt" + sandhi_u) ;
eight => ("eNNa:r" + sandhi_u) ;
four => ("Va:Va:r" + sandhi_u) ;
five => fiveh_sandhi ;
sg => ("Va:r" + sandhi_u) ;
_ => d.s ! attr1 ++ ("Va:r" + sandhi_u) } ! d.size ++ e.s ! indep ;
attrtwo =>
table {nine => ("toLLa:yiratt" + sandhi_u) ;
eight => ("eNNa:r" + sandhi_u) ;
four => ("Va:Va:r" + sandhi_u) ;
five => fiveh_sandhi ;
sg => ("Va:r" + sandhi_u) ;
_ => d.s ! attr1 ++ ("Va:r" + sandhi_u) } ! d.size ++ e.s ! indep ;
preceded =>
table {nine => ("toLLa:yiratt" + sandhi_u) ;
eight => ("eNNa:r" + sandhi_u) ;
four => ("Va:Va:r" + sandhi_u) ;
five => fiveh_sandhi ;
_ => d.s ! attr1 ++ ("Va:r" + sandhi_u) } ! d.size ++ e.s ! indep ;
lakhs => d.s ! unit ++ ("ilaTcatt" + sandhi_u) ++
table {sg => "a:yiram" ; _ => e.s ! attr ++ "a:yiram" } ! e.size ;
lakhs2 => d.s ! unit ++ ("ilaTcatt" + sandhi_u) ++
table {sg => "a:yiratt" + sandhi_u ; _ => e.s ! attr ++ ("a:yiratt" + sandhi_u) } ! e.size} ; size = more100} ;
lin pot2as3 n =
{s = n.s ! indeptwo} ;
lin pot3 n =
{s = table {sg => "a:yiram" ;
more100 => n.s ! lakhs ;
_ => n.s ! attrtwo ++ "a:yiram" } ! n.size } ;
lin pot3plus n m =
{s = table {sg => "a:yiratt" + sandhi_u;
more100 => n.s ! lakhs2 ;
_ => n.s ! attrtwo ++ "a:yiratt" + sandhi_u } ! n.size ++ m.s ! preceded} ;
|