diff options
| author | aarne <aarne@cs.chalmers.se> | 2008-06-25 16:43:48 +0000 |
|---|---|---|
| committer | aarne <aarne@cs.chalmers.se> | 2008-06-25 16:43:48 +0000 |
| commit | b96b36f43de3e2f8b58d5f539daa6f6d47f25870 (patch) | |
| tree | 0992334be13cec6538a1dea22fbbf26ad6bdf224 /src/GF/Text/Ethiopic.hs | |
| parent | fe367412e0aeb4ad5c02de68e6eca382e0f96984 (diff) | |
removed src for 2.9
Diffstat (limited to 'src/GF/Text/Ethiopic.hs')
| -rw-r--r-- | src/GF/Text/Ethiopic.hs | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/src/GF/Text/Ethiopic.hs b/src/GF/Text/Ethiopic.hs deleted file mode 100644 index 81abbf719..000000000 --- a/src/GF/Text/Ethiopic.hs +++ /dev/null @@ -1,72 +0,0 @@ ----------------------------------------------------------------------- --- | --- Module : Ethiopic --- Maintainer : HH --- Stability : (stable) --- Portability : (portable) --- --- > CVS $Date: 2005/04/21 16:23:35 $ --- > CVS $Author: bringert $ --- > CVS $Revision: 1.6 $ --- --- Ascii-Unicode decoding for Ethiopian. --- Copyright (c) Harald Hammarström 2003 under Gnu General Public License ------------------------------------------------------------------------------ - -module GF.Text.Ethiopic (mkEthiopic) where - -mkEthiopic :: String -> String -mkEthiopic = digraphWordToUnicode . adHocToDigraphWord - --- mkEthiopic :: String -> String --- mkEthiopic = reverse . unwords . (map (digraphWordToUnicode . adHocToDigraphWord)) . words ---- reverse : assumes everything's on same line - -adHocToDigraphWord :: String -> [(Char, Int)] -adHocToDigraphWord str = case str of - [] -> [] - '<' : cs -> ('<', -1) : spoolMarkup cs - c1 : cs | isVowel c1 -> (')', vowelOrder c1) : adHocToDigraphWord cs - -- c1 isn't a vowel - c1 : cs | not (elem c1 allEthiopicCodes) -> (c1, -1) : adHocToDigraphWord cs - c1 : c2 : cs | isVowel c2 -> (c1, vowelOrder c2) : adHocToDigraphWord cs - c1 : cs -> (c1, 5) : adHocToDigraphWord cs - -spoolMarkup :: String -> [(Char, Int)] -spoolMarkup s = case s of - -- [] -> [] -- Shouldn't happen - '>' : cs -> ('>', -1) : adHocToDigraphWord cs - c1 : cs -> (c1, -1) : spoolMarkup cs - -isVowel x = elem x "A\228ui\239aeoI" - -vowelOrder :: Char -> Int -vowelOrder x = case x of - 'A' -> 0 - '\228' -> 0 -- ä - 'u' -> 1 - 'i' -> 2 - 'a' -> 3 - 'e' -> 4 - 'I' -> 5 - '\239' -> 5 -- ï - 'o' -> 6 - c -> 5 -- vowelless - -digraphWordToUnicode = map digraphToUnicode - -digraphToUnicode :: (Char, Int) -> Char --- digraphToUnicode (c1, c2) = c1 - -digraphToUnicode (c1, -1) = c1 -digraphToUnicode (c1, c2) = toEnum (0x1200 + c2 + 8*case lookup c1 cc of Just c' -> c') - where - cc = zip allEthiopicCodes allEthiopic - -allEthiopic :: [Int] -allEthiopic = [0 .. 44] -- x 8 - -allEthiopicCodes = "hlHmLrs$KQ__bBtcxXnN)kW__w(zZyd_jgG_TCPSLfp" - --- Q = kW, X = xW, W = kW, G = gW - |
