add lexer and unlexer for Ancient Greek accent normalization

This commit is contained in:
leiss
2016-02-23 16:30:39 +00:00
parent 8548979d1c
commit df2901c9c0
4 changed files with 51 additions and 12 deletions

View File

@@ -3,6 +3,7 @@ module GF.Text.Lexing (stringOp,opInEnv) where
import GF.Text.Transliterations
import PGF.Lexing
import PGF.LexingAGreek(lexAGreek,unlexAGreek,lexAGreek2) -- HL 20.2.2016
import Data.Char (isSpace)
import Data.List (intersperse)
@@ -13,12 +14,15 @@ stringOp name = case name of
"lextext" -> Just $ appLexer lexText
"lexcode" -> Just $ appLexer lexCode
"lexmixed" -> Just $ appLexer lexMixed
"lexgreek" -> Just $ appLexer lexAGreek
"lexgreek2" -> Just $ appLexer lexAGreek2
"words" -> Just $ appLexer words
"bind" -> Just $ appUnlexer (unwords . bindTok)
"unchars" -> Just $ appUnlexer concat
"unlextext" -> Just $ appUnlexer (unlexText . unquote)
"unlexcode" -> Just $ appUnlexer unlexCode
"unlexmixed" -> Just $ appUnlexer (unlexMixed . unquote)
"unlexgreek" -> Just $ appUnlexer unlexAGreek
"unwords" -> Just $ appUnlexer unwords
"to_html" -> Just wrapHTML
_ -> transliterate name