Thai: transliterations in a separate src file; bind words in NumeralThai

This commit is contained in:
aarne
2011-11-06 21:10:58 +00:00
parent d058394219
commit 8ec4afde05
4 changed files with 202 additions and 89 deletions

View File

@@ -1,4 +1,4 @@
concrete NumeralTha of Numeral = CatTha ** open ResTha, StringsTha in {
concrete NumeralTha of Numeral = CatTha ** open ResTha, StringsTha, Prelude in {
lincat
-- Numeral = {s : Str} ;
@@ -27,26 +27,26 @@ lin
pot110 = {s = sip} ;
pot111 = {s = table {
Unit => sip_s ++ et_s ;
Thousand => nvg_s ++ mvvn_s ++ nvg_s ++ phan_s
Unit => thbind sip_s et_s ;
Thousand => thbind 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
Unit => thbind sip_s (d.s ! After) ;
Thousand => thbind 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} ;
pot0as1 d = {s = \\n => thbind (d.s ! Indep) (phan ! n)} ;
pot1 d = {s = \\n => thbind (d.s ! ModTen) (sip ! n)} ;
pot1plus d e = {
s = \\n => d.s ! ModTen ++ sip ! n ++ e.s ! After ++ phan ! n
s = \\n => thbind (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} ;
pot2 d = {s = \\n => thbind (d.s ! Indep) (roy ! n)} ;
pot2plus d e = {s = \\n => thbind (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} ;
pot3plus n m = {s = thbind (n.s ! Thousand) (m.s ! Unit)} ;
param
DForm = Indep | ModTen | After ;

View File

@@ -11,6 +11,22 @@ resource ResTha = ParamX ** open StringsTha, Prelude in {
oper
-- binding words together
thbind = overload {
thbind : Str -> Str = \s -> s ;
thbind : (s1,s2 : Str) -> Str = \s1,s2 -> s1 ++ BIND ++ s2 ;
thbind : (s1,_,s3 : Str) -> Str = \s1,s2,s3 -> s1 ++ BIND ++ s2 ++ BIND ++ s3 ;
thbind : (s1,_,_,s4 : Str) -> Str =
\s1,s2,s3,s4 -> s1 ++ BIND ++ s2 ++ BIND ++ s3 ++ BIND ++ s4 ;
thbind : (s1,_,_,_,s5 : Str) -> Str =
\s1,s2,s3,s4,s5 -> s1 ++ BIND ++ s2 ++ BIND ++ s3 ++ BIND ++ s4 ++ BIND ++ s5 ;
thbind : (s1,_,_,_,_,s6 : Str) -> Str =
\s1,s2,s3,s4,s5,s6 ->
s1 ++ BIND ++ s2 ++ BIND ++ s3 ++ BIND ++ s4 ++ BIND ++ s5 ++ BIND ++ s6 ;
} ;
-- noun and classifier
Noun = {s,c : Str} ;

View File

@@ -1,87 +1,92 @@
-- The only place where literal Thai strings are defined
-- (except for Lexicon and Structural).
-- Convert this into StringsThai by 'make strings'
-- Convert this into StringsThai by
-- gf
-- > rf -file=thai/src/StringsTha.gf | ps -env=quotes -to_thai | wf -file=thai/StringsTha.gf
-- สุคสันต์วันเกิด!
resource StringsTha = {
flags coding = utf8 ;
oper
aphai_s = "Op3ay" ; -- excuse2
baan_s = "bT2a:n" ; -- house
biar_s = "ebi:OrK" ; -- beer
ca_s = "ca." ; -- Modal
cet_s = "ecSd" ; -- seven
chan_s = "c1an" ; -- I
chay_s = "a%c2T1" ; -- yes
cheut_s = "ec2v:T2t" ; -- shirt2
chuay_s = "c2T1wy" ; -- help1
di_s = "di" ; -- I (fem)1
dii_s = "di:" ; -- hello2
duay_s = "dT2wy" ; -- help2
dvm_s = "dvm" ; -- drink
et_s = "eOSd" ; -- one'
haa_s = "hT2a:" ; -- five
hay_s = "a%hT2" ; -- give
hoog_s = "hT2Og" ; -- room
hok_s = "ho?k" ; -- six
jai_s = "a%j" ; -- understand2
kaaw_s = "eka:" ; -- nine
kew_s = "e'kT2w" ; -- glass (drink Classif)
khaw_s = "ek1a:" ; -- he
khon_s = "k2n" ; -- people Classif
khoo_s = "k1O" ; -- please
khoog_s = "k1Og" ; -- Possessive
khoop_s = "k1Ob" ; -- thank
khow_s = "ek1T2w" ; -- understand1
khun_s = "k2un'" ; -- you
koon_s = "kT1On" ; -- bye2
laa_s = "la:" ; -- bye1
lag_s = "hlag" ; -- houses Classif
lap_s = "hlab" ; -- sleep2
lem_s = "elT1m" ; -- books Classif
may_s = "a&mT1" ; -- not
m'ay_s = "a&hm" ; -- Question
mvvn_s = "hmv:T1n" ; -- ten thousand
nag_s = "hna.g" ; -- book1
nai_s = "a&hn" ; -- where2
nam_s = "na+" ; -- water
nan_s = "naT2n" ; -- that
nii_s = "ni:T2" ; -- this
nit_s = "nid" ; -- little1
noon_s = "nOn" ; -- sleep1
noi_s = "hnT1Oy" ; -- little2
nvg_s = "hnvg" ; -- one
pay_s = "a&p" ; -- go
peet_s = "e'pd" ; -- eight
pen_s = "epSn" ; -- be, can-know
phan_s = "p2an" ; -- thousand
phom_s = "p1m" ; -- I (masc)
puu_s = "p1u:T2" ; -- woman1
rai_s = "a&r" ; -- how-much2
rak_s = "rak" ; -- love
raw_s = "era:" ; -- we
rooy_s = "rT2Oy" ; -- hundred
saam_s = "sa:m" ; -- three
sawat_s = "swas" ; -- hello1
seen_s = "e'sn" ; -- hundred thousand
seua_s = "esv:T2O" ; -- shirt1
si_s = "s'i" ; -- Imperative
sii_s = "si:T1" ; -- four
sip_s = "sib" ; -- ten
soog_s = "sOg" ; -- two
svv_s = "sv:O" ; -- book2
thii_s = "t5i:T1" ; -- Ord
thoot_s = "o:t5r'" ; -- sorry2
thao_s = "et5T1a:" ; -- how-much1
tog_s = "tT2Og" ; -- must
waa_s = "wT1a:" ; -- that Conj
way_s = "a&hw" ; -- can-potent
yaa_s = "OyT1a:" ; -- Neg Imper
yaak_s = "Oya:k" ; -- want
yay_s = "a%hy'" ; -- big
yig_s = "hy'ig" ; -- woman2
yii_s = "yi:T1" ; -- two'
yin_s = "yin" ; -- you're-welcome1
yuu_s = "yu:" ; -- where0(?)
aphai_s = "อภัย" ; -- excuse2
baan_s = "บ้าน" ; -- house
biar_s = "เบีอร์" ; -- beer
ca_s = "จะ" ; -- Modal
cet_s = "เจ็ด" ; -- seven
chan_s = "ฉัน" ; -- I
chay_s = "ใช่" ; -- yes
cheut_s = "เชื้ต" ; -- shirt2
chuay_s = "ช่วย" ; -- help1
di_s = "ดิ" ; -- I (fem)1
dii_s = "ดี" ; -- hello2
duay_s = "ด้วย" ; -- help2
dvm_s = "ดึม" ; -- drink
et_s = "เอ็ด" ; -- one'
haa_s = "ห้า" ; -- five
hay_s = "ให้" ; -- give
hoog_s = "ห้อง" ; -- room
hok_s = "หก" ; -- six
jai_s = "j" ; -- understand2
kaaw_s = "เกา" ; -- nine
kew_s = "แก้ว" ; -- glass (drink Classif)
khaw_s = "เขา" ; -- he
khon_s = "คน" ; -- people Classif
khoo_s = "ขอ" ; -- please
khoog_s = "ของ" ; -- Possessive
khoop_s = "ขอบ" ; -- thank
khow_s = "เข้ว" ; -- understand1
khun_s = "คุณ" ; -- you
koon_s = "ก่อน" ; -- bye2
laa_s = "ลา" ; -- bye1
lag_s = "หลัง" ; -- houses Classif
lap_s = "หลับ" ; -- sleep2
lem_s = "เล่ม" ; -- books Classif
may_s = "ไม่" ; -- not
m'ay_s = "ไหม" ; -- Question
mvvn_s = "หมื่น" ; -- ten thousand
nag_s = "หนะง" ; -- book1
nai_s = "ไหน" ; -- where2
nam_s = "นำ" ; -- water
nan_s = "นั้น" ; -- that
nii_s = "นี้" ; -- this
nit_s = "นิด" ; -- little1
noon_s = "นอน" ; -- sleep1
noi_s = "หน่อย" ; -- little2
nvg_s = "หนึง" ; -- one
pay_s = "ไป" ; -- go
peet_s = "แปด" ; -- eight
pen_s = "เป็น" ; -- be, can-know
phan_s = "พัน" ; -- thousand
phom_s = "ผม" ; -- I (masc)
puu_s = "ผู้" ; -- woman1
rai_s = "ไร" ; -- how-much2
rak_s = "รัก" ; -- love
raw_s = "เรา" ; -- we
rooy_s = "ร้อย" ; -- hundred
saam_s = "สาม" ; -- three
sawat_s = "สวัส" ; -- hello1
seen_s = "แสน" ; -- hundred thousand
seua_s = "เสื้อ" ; -- shirt1
si_s = "ซิ" ; -- Imperative
sii_s = "สี่" ; -- four
sip_s = "สิบ" ; -- ten
soog_s = "สอง" ; -- two
svv_s = "สือ" ; -- book2
thii_s = "ที่" ; -- Ord
thoot_s = "โทr'" ; -- sorry2
thao_s = "เท่า" ; -- how-much1
tog_s = "ต้อง" ; -- must
waa_s = "ว่า" ; -- that Conj
way_s = "ไหว" ; -- can-potent
yaa_s = "อย่า" ; -- Neg Imper
yaak_s = "อยาก" ; -- want
yay_s = "ใหญ" ; -- big
yig_s = "หญิง" ; -- woman2
yii_s = "ยี่" ; -- two'
yin_s = "ยิน" ; -- you're-welcome1
yuu_s = "ยู" ; -- where0(?)
}

View File

@@ -0,0 +1,92 @@
-- The only place where literal Thai strings are defined
-- (except for Lexicon and Structural).
-- Convert this into StringsThai by
-- gf
-- > rf -file=thai/src/StringsTha.gf | ps -env=quotes -to_thai | wf -file=thai/StringsTha.gf
-- สุคสันต์วันเกิด!
resource StringsTha = {
flags coding = utf8 ;
oper
aphai_s = "Op3ay" ; -- excuse2
baan_s = "bT2a:n" ; -- house
biar_s = "ebi:OrK" ; -- beer
ca_s = "ca." ; -- Modal
cet_s = "ecSd" ; -- seven
chan_s = "c1an" ; -- I
chay_s = "a%c2T1" ; -- yes
cheut_s = "ec2v:T2t" ; -- shirt2
chuay_s = "c2T1wy" ; -- help1
di_s = "di" ; -- I (fem)1
dii_s = "di:" ; -- hello2
duay_s = "dT2wy" ; -- help2
dvm_s = "dvm" ; -- drink
et_s = "eOSd" ; -- one'
haa_s = "hT2a:" ; -- five
hay_s = "a%hT2" ; -- give
hoog_s = "hT2Og" ; -- room
hok_s = "hk" ; -- six
jai_s = "a%j" ; -- understand2
kaaw_s = "eka:" ; -- nine
kew_s = "e'kT2w" ; -- glass (drink Classif)
khaw_s = "ek1a:" ; -- he
khon_s = "k2n" ; -- people Classif
khoo_s = "k1O" ; -- please
khoog_s = "k1Og" ; -- Possessive
khoop_s = "k1Ob" ; -- thank
khow_s = "ek1T2w" ; -- understand1
khun_s = "k2un'" ; -- you
koon_s = "kT1On" ; -- bye2
laa_s = "la:" ; -- bye1
lag_s = "hlag" ; -- houses Classif
lap_s = "hlab" ; -- sleep2
lem_s = "elT1m" ; -- books Classif
may_s = "a&mT1" ; -- not
m'ay_s = "a&hm" ; -- Question
mvvn_s = "hmv:T1n" ; -- ten thousand
nag_s = "hna.g" ; -- book1
nai_s = "a&hn" ; -- where2
nam_s = "na+" ; -- water
nan_s = "naT2n" ; -- that
nii_s = "ni:T2" ; -- this
nit_s = "nid" ; -- little1
noon_s = "nOn" ; -- sleep1
noi_s = "hnT1Oy" ; -- little2
nvg_s = "hnvg" ; -- one
pay_s = "a&p" ; -- go
peet_s = "e'pd" ; -- eight
pen_s = "epSn" ; -- be, can-know
phan_s = "p2an" ; -- thousand
phom_s = "p1m" ; -- I (masc)
puu_s = "p1u:T2" ; -- woman1
rai_s = "a&r" ; -- how-much2
rak_s = "rak" ; -- love
raw_s = "era:" ; -- we
rooy_s = "rT2Oy" ; -- hundred
saam_s = "sa:m" ; -- three
sawat_s = "swas" ; -- hello1
seen_s = "e'sn" ; -- hundred thousand
seua_s = "esv:T2O" ; -- shirt1
si_s = "s'i" ; -- Imperative
sii_s = "si:T1" ; -- four
sip_s = "sib" ; -- ten
soog_s = "sOg" ; -- two
svv_s = "sv:O" ; -- book2
thii_s = "t5i:T1" ; -- Ord
thoot_s = "o:t5r'" ; -- sorry2
thao_s = "et5T1a:" ; -- how-much1
tog_s = "tT2Og" ; -- must
waa_s = "wT1a:" ; -- that Conj
way_s = "a&hw" ; -- can-potent
yaa_s = "OyT1a:" ; -- Neg Imper
yaak_s = "Oya:k" ; -- want
yay_s = "a%hy'" ; -- big
yig_s = "hy'ig" ; -- woman2
yii_s = "yi:T1" ; -- two'
yin_s = "yin" ; -- you're-welcome1
yuu_s = "yu:" ; -- where0(?)
}