diff options
| author | aarne <aarne@cs.chalmers.se> | 2007-01-09 14:53:19 +0000 |
|---|---|---|
| committer | aarne <aarne@cs.chalmers.se> | 2007-01-09 14:53:19 +0000 |
| commit | 0882e5eac274f11a0cd3a98fa93c57d6ee479981 (patch) | |
| tree | cd53d2dc5add45174547168c7ab4aee8051e488d /src/GF/Text | |
| parent | 159f6515f7947ceb4adeba75d0d7242f732dd1a2 (diff) | |
thai phrasebook example started
Diffstat (limited to 'src/GF/Text')
| -rw-r--r-- | src/GF/Text/Thai.hs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/GF/Text/Thai.hs b/src/GF/Text/Thai.hs index 33d2b3a16..eda261051 100644 --- a/src/GF/Text/Thai.hs +++ b/src/GF/Text/Thai.hs @@ -121,6 +121,7 @@ pronSyllable s = vowel = case (initv s, midv s, finalv s, shorten s, tone s) of ([0x0e40],[0x0e30,0x0e2d],_,_,_) -> "รถ" -- eOa ([0x0e40],[0x0e30,0x0e32],_,_,_) -> "o" -- ea:a + ([],[],[],_,_) -> "o" (i,m,f,_,_) -> concatMap pronThaiChar (reverse $ f ++ m ++ i) ---- initCons = concatMap pronThaiChar $ case (reverse $ initc s) of @@ -179,12 +180,14 @@ getSyllable = foldl get (Syll [] [] [] [] [] [] False False) where | isVowel c -> if null (initc syll) then syll {initv = c : initv syll} else syll {midv = c : midv syll} - | isCons c -> if null (midv syll) + | isCons c -> if null (initc syll) || + (null (midv syll) && isCluster (initc syll) c) then syll {initc = c : initc syll} else syll {finalc = c : finalc syll} | isTone c -> syll {tone = [c]} _ -> syll ---- check this + isCluster s c = length s == 1 && (c == 0x0e23 || s == [0x0e2b]) -- to test |
