1
0
forked from GitHub/gf-core

ergatives with postpos complements in Hindi

This commit is contained in:
aarne
2008-05-07 08:57:07 +00:00
parent c4a3cd633e
commit 1c00d693ad
10 changed files with 82 additions and 52 deletions

View File

@@ -1,7 +1,7 @@
main = interact udeva
udeva :: String -> String
udeva = encodeUTF8 . str2deva
udeva = unlines . map (unwords . map (encodeUTF8 . str2deva) . words) . lines
str2deva :: String -> String
str2deva s = map toEnum $ case chop s of
@@ -9,6 +9,8 @@ str2deva s = map toEnum $ case chop s of
_ -> []
chop s = case s of
['-'] -> [s]
'-' :cs -> let (c:r) = chop cs in ('-':c) : r -- to force initial vowel
v:':':cs -> [v,':'] : chop cs
v:'.':cs -> [v,'.'] : chop cs
c:'a':cs -> [c] : chop cs
@@ -17,6 +19,7 @@ chop s = case s of
encodeInit :: String -> Int
encodeInit s = case s of
'-':c -> encodeInit c
"a" -> 0x0905
"a:" -> 0x0906
"i" -> 0x0907
@@ -91,6 +94,8 @@ encode s = case s of
" " -> space
"\n" -> fromEnum '\n'
'-':c -> encodeInit c
_ -> 0x093e --- a: