From 793dd89f7ed64652391dffc2d35e5eb6ada9e768 Mon Sep 17 00:00:00 2001 From: aarne Date: Tue, 17 Mar 2009 22:04:20 +0000 Subject: [PATCH] Greek (modern) transliteration scheme --- src/GF/Command/Commands.hs | 5 ++++- src/GF/Text/Transliterations.hs | 11 +++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/GF/Command/Commands.hs b/src/GF/Command/Commands.hs index eda61255f..e6ee4a80c 100644 --- a/src/GF/Command/Commands.hs +++ b/src/GF/Command/Commands.hs @@ -522,6 +522,7 @@ allCommands cod env@(pgf, mos) = Map.fromList [ return $ fromString out, options = [ ("arabic", "Arabic"), + ("greek", "Greek (modern)"), ("devanagari","Devanagari"), ("telugu", "Telugu"), ("thai", "Thai") @@ -681,7 +682,8 @@ stringOpOptions = [ ("from_cp1251","decode from cp1251 (Cyrillic used in Bulgarian resource)"), ("from_arabic","from unicode to GF Arabic transliteration"), ("from_devanagari","from unicode to GF Devanagari transliteration"), - ("from_thai","from unicode to GF Telugu transliteration"), + ("from_greek","from unicode to GF modern Greek transliteration"), + ("from_telugu","from unicode to GF Telugu transliteration"), ("from_thai","from unicode to GF Thai transliteration"), ("from_utf8","decode from utf8 (default)"), ("lextext","text-like lexer"), @@ -690,6 +692,7 @@ stringOpOptions = [ ("to_cp1251","encode to cp1251 (Cyrillic used in Bulgarian resource)"), ("to_arabic","from GF Arabic transliteration to unicode"), ("to_devanagari","from GF Devanagari transliteration to unicode"), + ("to_greek","from GF modern Greek transliteration to unicode"), ("to_html","wrap in a html file with linebreaks"), ("to_telugu","from GF Telugu transliteration to unicode"), ("to_thai","from GF Thai transliteration to unicode"), diff --git a/src/GF/Text/Transliterations.hs b/src/GF/Text/Transliterations.hs index e77d30fc4..190fab211 100644 --- a/src/GF/Text/Transliterations.hs +++ b/src/GF/Text/Transliterations.hs @@ -28,6 +28,7 @@ transliteration :: String -> Maybe Transliteration transliteration s = case s of "arabic" -> Just transArabic "devanagari" -> Just transDevanagari + "greek" -> Just transGreek "telugu" -> Just transTelugu "thai" -> Just transThai ---- "urdu" -> Just transUrdu @@ -128,3 +129,13 @@ transTelugu = mkTransliteration allTrans allCodes where "R+ L+ l+ l* - - n0 n1 n2 n3 n4 n5 n6 n7 n8 n9 " allCodes = [0x0c00 .. 0x0c7f] +transGreek :: Transliteration +transGreek = mkTransliteration allTrans allCodes where + allTrans = words $ + "- - - - - - A' - E' H' I' - O' - Y' W' " ++ + "i= A B G D E Z H V I K L M N X O " ++ + "P R - S T Y F C Q W I- Y- a' e' h' i' " ++ + "y= a b g d e z h v i k l m n x o " ++ + "p r s* s t y f c q w i- y- o' y' w' - " + allCodes = [0x0380 .. 0x03cf] +