1
0
forked from GitHub/gf-core

completed Paradigms documentation for Cat,Ita,Nor,Spa,Dan

This commit is contained in:
aarne
2010-12-19 11:33:02 +00:00
parent c4f2ebacb2
commit 11086f981d
12 changed files with 594 additions and 947 deletions

View File

@@ -121,7 +121,7 @@ rulesTable aexx hasEx isLatex cs file = do
getRules :: ApiExx -> FilePath -> IO Rules
getRules aexx file = do
ss <- readFileC file >>= return . filter (not . hiddenLine) . lines
ss <- readFileC (coding file) file >>= return . filter (not . hiddenLine) . lines
return $ getrs [] ss
where
getrs rs ss = case ss of
@@ -311,7 +311,18 @@ showTyp cs = unwords . map f . words
&& isUpper (head cat)
-- to work around GHC 6.12 file input
readFileC file = do
readFileC cod file = do
let tmp = file ++ ".tmp"
system $ "iconv -f ISO-8859-1 -t UTF-8 " ++ file ++ " >" ++ tmp
readFile tmp
case cod of
"utf8" -> readFile file
_ -> do
system $ "iconv -f ISO-8859-1 -t UTF-8 " ++ file ++ " >" ++ tmp
readFile tmp
coding file = case language file of
"Pol" -> "utf8"
"Rus" -> "utf8"
_ -> "latin1"
language = reverse . take 3 . drop 3 . reverse