allow empty lines in transliteration files

This commit is contained in:
aarne
2011-06-14 11:49:10 +00:00
parent 67c804d9a8
commit a772c0af48

View File

@@ -90,7 +90,7 @@ mkTransliteration name ts us =
getTransliterationFile :: String -> String -> Transliteration
getTransliterationFile name = uncurry (mkTransliteration name) . codes
where
codes = unzip . map (mkOne . words) . lines
codes = unzip . map (mkOne . words) . filter (not . all isSpace) . lines
mkOne ws = case ws of
[c]:t:_ -> (t,fromEnum c) -- ä a:
u:t:_ -> (t,read u) -- 228 a: OR 0xe4