summaryrefslogtreecommitdiff
path: root/src/GF/Text
diff options
context:
space:
mode:
authorbringert <bringert@cs.chalmers.se>2006-05-20 02:56:06 +0000
committerbringert <bringert@cs.chalmers.se>2006-05-20 02:56:06 +0000
commitb7e1e31909fe6e89887ade077c90c5fdb2081434 (patch)
tree0a51c14881df222ac5799330a7abddd66eb968b5 /src/GF/Text
parent49849d7fe381bdf20e66e5255ee7d27a8dc300f9 (diff)
Changes to make GF compile with GHC 6.5 from CVS: remove inlines use of !, change all latin-1 characters in haskell code to escapes.
Diffstat (limited to 'src/GF/Text')
-rw-r--r--src/GF/Text/Devanagari.hs2
-rw-r--r--src/GF/Text/Ethiopic.hs6
-rw-r--r--src/GF/Text/LatinASupplement.hs2
-rw-r--r--src/GF/Text/OCSCyrillic.hs2
-rw-r--r--src/GF/Text/Russian.hs15
-rw-r--r--src/GF/Text/Tamil.hs2
-rw-r--r--src/GF/Text/Text.hs10
7 files changed, 25 insertions, 14 deletions
diff --git a/src/GF/Text/Devanagari.hs b/src/GF/Text/Devanagari.hs
index 6bd23149f..bf4343cd0 100644
--- a/src/GF/Text/Devanagari.hs
+++ b/src/GF/Text/Devanagari.hs
@@ -82,7 +82,7 @@ digraphToUnicode (c1, c2) = case lookup (c1, c2) cc of Just c' -> c' ; _ -> c2
where
cc = zip allDevanagariCodes allDevanagari
-digraphedDevanagari = " ~ M ;__ AA: II: UU:RoLoEvE~ EE:AvA~ OAU kkH ggHNG ccH jjH ñ TTH DDH N ttH ddH nn. ppH bbH m y rr. l LL. v ç S s h____ .-Sa: ii: uu:ror:eve~ eaiava~ oau ^____OM | -dddu______ Q X G zD.RH fy.R:L:mrmR#I#d#0#1#2#3#4#5#6#7#8#9#o"
+digraphedDevanagari = " ~ M ;__ AA: II: UU:RoLoEvE~ EE:AvA~ OAU kkH ggHNG ccH jjH \241 TTH DDH N ttH ddH nn. ppH bbH m y rr. l LL. v \231 S s h____ .-Sa: ii: uu:ror:eve~ eaiava~ oau ^____OM | -dddu______ Q X G zD.RH fy.R:L:mrmR#I#d#0#1#2#3#4#5#6#7#8#9#o"
allDevanagariCodes :: [(Char, Char)]
allDevanagariCodes = mkPairs digraphedDevanagari
diff --git a/src/GF/Text/Ethiopic.hs b/src/GF/Text/Ethiopic.hs
index 26ae4b933..81abbf719 100644
--- a/src/GF/Text/Ethiopic.hs
+++ b/src/GF/Text/Ethiopic.hs
@@ -38,18 +38,18 @@ spoolMarkup s = case s of
'>' : cs -> ('>', -1) : adHocToDigraphWord cs
c1 : cs -> (c1, -1) : spoolMarkup cs
-isVowel x = elem x "AäuiïaeoI"
+isVowel x = elem x "A\228ui\239aeoI"
vowelOrder :: Char -> Int
vowelOrder x = case x of
'A' -> 0
- 'ä' -> 0
+ '\228' -> 0 -- ä
'u' -> 1
'i' -> 2
'a' -> 3
'e' -> 4
'I' -> 5
- 'ï' -> 5
+ '\239' -> 5 -- ï
'o' -> 6
c -> 5 -- vowelless
diff --git a/src/GF/Text/LatinASupplement.hs b/src/GF/Text/LatinASupplement.hs
index de6e170ac..f42423c91 100644
--- a/src/GF/Text/LatinASupplement.hs
+++ b/src/GF/Text/LatinASupplement.hs
@@ -32,7 +32,7 @@ mkLatinASupplementWord str = case str of
-- Turkish
'g' : '%' : cs -> toEnum 0x011f : mkLatinASupplementWord cs
'I' : cs -> toEnum 0x0131 : mkLatinASupplementWord cs
- 'c' : ',' : cs -> 'ç' : mkLatinASupplementWord cs
+ 'c' : ',' : cs -> toEnum 0x00e7 : mkLatinASupplementWord cs
-- Polish
'e' : ',' : cs -> toEnum 0x0119 : mkLatinASupplementWord cs
'a' : ',' : cs -> toEnum 0x0105 : mkLatinASupplementWord cs
diff --git a/src/GF/Text/OCSCyrillic.hs b/src/GF/Text/OCSCyrillic.hs
index 7bbd1a773..0d4696944 100644
--- a/src/GF/Text/OCSCyrillic.hs
+++ b/src/GF/Text/OCSCyrillic.hs
@@ -21,7 +21,7 @@ mkOCSCyrillicWord str = case str of
[] -> []
' ' : cs -> ' ' : mkOCSCyrillicWord cs
'<' : cs -> '<' : spoolMarkup cs
- 'ä' : cs -> toEnum 0x0463 : mkOCSCyrillicWord cs
+ '\228' : cs -> toEnum 0x0463 : mkOCSCyrillicWord cs -- ä
'j' : 'e' : '~' : cs -> toEnum 0x0469 : mkOCSCyrillicWord cs
'j' : 'o' : '~' : cs -> toEnum 0x046d : mkOCSCyrillicWord cs
'j' : 'e' : cs -> toEnum 0x0465 : mkOCSCyrillicWord cs
diff --git a/src/GF/Text/Russian.hs b/src/GF/Text/Russian.hs
index 5e49d2fbb..c4f1bfd89 100644
--- a/src/GF/Text/Russian.hs
+++ b/src/GF/Text/Russian.hs
@@ -34,10 +34,21 @@ mkRussianChar chars c = case lookup c cc of Just c' -> c' ; _ -> c
where
cc = zip chars allRussian
+allRussianCodes :: [Char]
allRussianCodes =
- "ÅåABVGDEXZIJKLMNOPRSTUFHCQW£}!*ÖYÄabvgdexzijklmnoprstufhcqw#01'öyä"
+ -- changed to Ints to work with Haskell compilers e.g. GHC 6.5 CVS
+ -- which expect source files to be in UTF-8
+ -- /bringert 2006-05-19
+ -- "ÅåABVGDEXZIJKLMNOPRSTUFHCQW£}!*ÖYÄabvgdexzijklmnoprstufhcqw#01'öyä"
+ map toEnum [197,229,65,66,86,71,68,69,88,90,73,74,75,76,77,78,79,80,82,83,84,85,70,72,67,81,87,163,125,33,42,214,89,196,97,98,118,103,100,101,120,122,105,106,107,108,109,110,111,112,114,115,116,117,102,104,99,113,119,35,48,49,39,246,121,228]
+
+allRussianKOI8 :: [Char]
allRussianKOI8 =
- "^@áâ÷çäåöúéêëìíîïðòóôõæèãþûýøùÿüàñÁÂ×ÇÄÅÖÚÉÊËÌÍÎÏÐÒÓÔÕÆÈÃÞÛÝØÙßÜÀÑ"
+ -- changed to Ints to work with Haskell compilers e.g. GHC 6.5 CVS
+ -- which expect source files to be in UTF-8
+ -- /bringert 2006-05-19
+ -- "^@áâ÷çäåöúéêëìíîïðòóôõæèãþûýøùÿüàñÁÂ×ÇÄÅÖÚÉÊËÌÍÎÏÐÒÓÔÕÆÈÃÞÛÝØÙßÜÀÑ"
+ map toEnum [94,64,225,226,247,231,228,229,246,250,233,234,235,236,237,238,239,240,242,243,244,245,230,232,227,254,251,253,248,249,255,252,224,241,193,194,215,199,196,197,214,218,201,202,203,204,205,206,207,208,210,211,212,213,198,200,195,222,219,221,216,217,223,220,192,209]
allRussian :: String
allRussian = (map toEnum (0x0401:0x0451:[0x0410 .. 0x044f])) -- Ëë in odd places
diff --git a/src/GF/Text/Tamil.hs b/src/GF/Text/Tamil.hs
index e938247c0..8ee171acf 100644
--- a/src/GF/Text/Tamil.hs
+++ b/src/GF/Text/Tamil.hs
@@ -73,5 +73,5 @@ allTamilCodes = mkPairs digraphedTamil
allTamil :: String
allTamil = (map toEnum [0x0b85 .. 0x0bfa])
-digraphedTamil = " AA: II: UU:______ EE:AI__ OO:AU k______ G c__ j__ ñ T______ N t______ V n p______ m y r l L M v__ s S h________a: ii: uu:______ ee:ai__ oo:au .__________________ :______________________________#1#2#3#4#5#6#7#8#9^1^2^3=d=m=y=d=c==ru##"
+digraphedTamil = " AA: II: UU:______ EE:AI__ OO:AU k______ G c__ j__ \241 T______ N t______ V n p______ m y r l L M v__ s S h________a: ii: uu:______ ee:ai__ oo:au .__________________ :______________________________#1#2#3#4#5#6#7#8#9^1^2^3=d=m=y=d=c==ru##"
diff --git a/src/GF/Text/Text.hs b/src/GF/Text/Text.hs
index a2a69f70c..b55355c20 100644
--- a/src/GF/Text/Text.hs
+++ b/src/GF/Text/Text.hs
@@ -82,7 +82,7 @@ formatAsTextGen tag para = unwords . format . cap . words where
major = flip elem (map singleton ".!?")
minor = flip elem (map singleton ",:;)")
openp = all (flip elem "(")
- spanish = all (flip elem "¡¿")
+ spanish = all (flip elem "\161\191")
formatAsCode :: String -> String
formatAsCode = rend 0 . words where
@@ -125,10 +125,10 @@ performBindsFinnish :: String -> String
performBindsFinnish = performBindsOpt vowelHarmony where
vowelHarmony w p = if any (flip elem "aouAOU") w then p else map toFront p
toFront c = case c of
- 'A' -> 'Ä'
- 'O' -> 'Ö'
- 'a' -> 'ä'
- 'o' -> 'ö'
+ 'A' -> '\196'
+ 'O' -> '\214'
+ 'a' -> '\228'
+ 'o' -> '\246'
_ -> c
unStringLit :: String -> String