corrections in thai numerals

This commit is contained in:
aarne
2006-12-28 14:30:25 +00:00
parent f6105a2ef4
commit 83c2aa92a2
3 changed files with 15 additions and 11 deletions

View File

@@ -3,6 +3,8 @@ include numerals.Abs.gf ;
-- Thai transliteration, produces thaiU.gf by GF/Text/Thai.hs -- Thai transliteration, produces thaiU.gf by GF/Text/Thai.hs
-- AR 28/12/2006 -- AR 28/12/2006
flags coding=utf8 ;
lincat lincat
Numeral = {s : Str} ; Numeral = {s : Str} ;
Digit = {s : DForm => Str} ; Digit = {s : DForm => Str} ;
@@ -18,10 +20,10 @@ lin
n2 = mkNum "s-Og" "y'i:E" "s-Og" ; n2 = mkNum "s-Og" "y'i:E" "s-Og" ;
n3 = regNum "s-a:m" ; n3 = regNum "s-a:m" ;
n4 = regNum "s-i:E" ; n4 = regNum "s-i:E" ; -- E = E48 '
n5 = regNum "ha:E" ; n5 = regNum "hTa:" ; -- T = E49 9
n6 = regNum "ho?k" ; n6 = regNum "ho?k" ;
n7 = regNum "ecMd'" ; n7 = regNum "ecMd'" ; -- M = E47 w
n8 = regNum "e:pd'" ; n8 = regNum "e:pd'" ;
n9 = regNum "eka:" ; n9 = regNum "eka:" ;
@@ -63,5 +65,5 @@ oper
sip = table {Unit => "s'ib" ; Thousand => "hmv:En"} ; sip = table {Unit => "s'ib" ; Thousand => "hmv:En"} ;
roy = table {Unit => "rEOy'" ; Thousand => "se:n"} ; roy = table {Unit => "rTOy'" ; Thousand => "se:n"} ;
phan = table {Unit => [] ; Thousand => "p2an"} ; phan = table {Unit => [] ; Thousand => "p2an"} ;

View File

@@ -1,6 +1,7 @@
include numerals.Abs.gf ; include numerals.Abs.gf ;
-- Thai UTF8, produced from thai.gf by GF/Text/Thai.hs. AR 28/12/2006 -- Thai transliteration, produces thaiU.gf by GF/Text/Thai.hs
-- AR 28/12/2006
flags coding=utf8 ; flags coding=utf8 ;
@@ -19,10 +20,10 @@ lin
n2 = mkNum "สอง" "ยี่" "สอง" ; n2 = mkNum "สอง" "ยี่" "สอง" ;
n3 = regNum "สาม" ; n3 = regNum "สาม" ;
n4 = regNum "สี่" ; n4 = regNum "สี่" ; -- E = E48 '
n5 = regNum "หา" ; n5 = regNum "หา" ; -- T = E49 9
n6 = regNum "หก" ; n6 = regNum "หก" ;
n7 = regNum "เจ็ด" ; n7 = regNum "เจ็ด" ; -- M = E47 w
n8 = regNum "แปด" ; n8 = regNum "แปด" ;
n9 = regNum "เกา" ; n9 = regNum "เกา" ;
@@ -64,5 +65,5 @@ oper
sip = table {Unit => "ศิบ" ; Thousand => "หมื่น"} ; sip = table {Unit => "ศิบ" ; Thousand => "หมื่น"} ;
roy = table {Unit => "รอย" ; Thousand => "ซแน"} ; roy = table {Unit => "รอย" ; Thousand => "ซแน"} ;
phan = table {Unit => [] ; Thousand => "พะน"} ; phan = table {Unit => [] ; Thousand => "พะน"} ;

View File

@@ -102,12 +102,13 @@ thaiFinalMap = Map.fromList $ zip allThaiTrans finals
thaiTable :: String thaiTable :: String
thaiTable = unlines [ thaiTable = unlines [
"\t" ++
hex c ++ "\t" ++ hex c ++ "\t" ++
encodeUTF8 (showThai s) ++ "\t" ++ encodeUTF8 (showThai s) ++ "\t" ++
s ++ "\t" ++ s ++ "\t" ++
pronThai s ++ "\t" ++ pronThai s ++ "\t" ++
[f] ++ "\t" ++ [f] ++ "\t" ++
[q] [q] ++ "\t"
| |
(c,q,f,s) <- zip4 allThaiCodes heights finals allThaiTrans (c,q,f,s) <- zip4 allThaiCodes heights finals allThaiTrans
] ]
@@ -119,7 +120,7 @@ showThai s = case s of
pronThai s = case s of pronThai s = case s of
[c,p] [c,p]
| isUpper c && isDigit p -> show p | isUpper c && isDigit p -> [p]
| isDigit p -> c:"h" | isDigit p -> c:"h"
| p==':' -> c:[c] | p==':' -> c:[c]
| elem p "%&" -> c:"y" | elem p "%&" -> c:"y"