cndict 0.5.5 → 0.6.0
raw patch · 2 files changed
+18/−1 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Data.Chinese.CCDict: toSimplified :: Text -> Text
+ Data.Chinese.CCDict: toTraditional :: Text -> Text
Files
- cndict.cabal +1/−1
- src/Data/Chinese/CCDict.hs +17/−0
cndict.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: cndict-version: 0.5.5+version: 0.6.0 synopsis: Chinese/Mandarin <-> English dictionary, Chinese lexer. -- description: license: PublicDomain
src/Data/Chinese/CCDict.hs view
@@ -12,6 +12,8 @@ , ccDict , Token(..) , tokenizer+ , toTraditional+ , toSimplified ) where import Data.Char@@ -413,6 +415,21 @@ splitDefinition :: Text -> [Text] splitDefinition = filter (not . T.null) . T.splitOn "/" . T.dropAround isSpace ++--------------------------------------------------+-- Simplified <-> Traditional++flatMap :: (Entry -> Text) -> [Token] -> Text+flatMap fn = T.concat . map worker+ where+ worker (KnownWord e) = fn e+ worker (UnknownWord txt) = txt++toTraditional :: Text -> Text+toTraditional = flatMap entryTraditional . tokenizer ccDict++toSimplified :: Text -> Text+toSimplified = flatMap entrySimplified . tokenizer ccDict -------------------------------------------------- -- Embedded dictionary