Safe Haskell | Safe-Inferred |
---|
The module provides a simple embedded domain specific language for defining transliteration rules. All parsers are case-insensitive by default.
- data TrRules = TrRules {}
- transliter :: TrRules -> String -> String
- type Parser = Parsec String ()
- ciString :: String -> Parser String
- ciChar :: Char -> Parser Char
- (#>) :: String -> String -> Parser String
- (>#>) :: Parser String -> String -> Parser String
- (>+>) :: Parser String -> Parser String -> Parser String
- (.|) :: String -> String -> Parser String
- (.|.) :: Parser String -> String -> Parser String
Transliteration
A set of transliteration rules.
transliter :: TrRules -> String -> StringSource
Transliterate the word with the given set of transliteration rules.
Parsers
Operators
(#>) :: String -> String -> Parser StringSource
A transliteration rule, e.g. ("abc" #> "bcd") will substitute all "abc" (sub)string instances with "bcd".
(>#>) :: Parser String -> String -> Parser StringSource
Similar to `#>`, but this function allows to define a custom parser for the string which should be substituted with another string.