1
0
forked from GitHub/gf-core

normalized accents in Thai pronunciation test suite

This commit is contained in:
aarne
2011-11-11 21:22:18 +00:00
parent 79ba3c0877
commit 6dc844ed7f
2 changed files with 100 additions and 92 deletions

View File

@@ -14,12 +14,20 @@ test = do
testOne ws = case ws of
m:t:p:r:_ -> appendFile resultFile $ concat [mn,"\t",t,"\t",p,"\t",r,"\t",result,"\n"] where
result = unwords (map thai2pron (words t))
result = unwords (intersperse "," (map thai2pron (filter (/=",") (words t))))
mn = if result == r
then m
else if result == p then (m ++ "+") else (m ++ "-")
_ -> return ()
testOneS ws = case ws of
m:t:p:r:_ -> appendFile resultFile $ concat [m,"\t",t,"\t",pn,"\t",r,"\n"] where
result = unwords (intersperse "," (map thai2pron (filter (/=",") (words t))))
pn = if m == "+"
then r
else p
_ -> return ()
tabs s = case break (=='\t') s of
([], _:ws) -> tabs ws
(w , _:ws) -> w:tabs ws