cndict 0.7.4 → 0.7.5
raw patch · 4 files changed
+19/−4 lines, 4 files
Files
- cndict.cabal +1/−1
- data/dict.sorted too large to diff
- src/Data/Chinese/CCDict.hs +6/−2
- src/Data/Chinese/Segmentation.hs +12/−1
cndict.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: cndict-version: 0.7.4+version: 0.7.5 synopsis: Chinese/Mandarin <-> English dictionary, Chinese lexer. -- description: license: PublicDomain
data/dict.sorted view
file too large to diff
src/Data/Chinese/CCDict.hs view
@@ -119,6 +119,12 @@ where (lower, upper) = bounds ccDict +allVariants :: [Variant]+allVariants = worker 0+ where+ worker nth | nth > snd (bounds ccDict) = []+ worker nth = parseVariant (ccDictNth nth ccDict) : worker (nth+1)+ scrapeEntry :: CCDict -> Int -> Text -> Maybe Entry scrapeEntry dict nth key = case variants of@@ -233,5 +239,3 @@ -- /first/second/third/ -> [first, second, third] splitDefinition :: Text -> [Text] splitDefinition = filter (not . T.null) . T.splitOn "/" . T.dropAround isSpace--
src/Data/Chinese/Segmentation.hs view
@@ -76,7 +76,10 @@ ,["这", "位子"] ,["十", "分钟"] ,["一", "点钟"]- ,["合上", "书"]]+ ,["合上", "书"]+ ,["第二", "天性"]+ ,["都", "会"]+ ,["上", "都"]] greedyGroups :: [[[Token]]] -> [[[Token]]] greedyGroups = map worker@@ -216,6 +219,14 @@ , ("我合上书准备离开", "我 合上 书 准备 离开") , ("他的话","他 的 话") , ("你用什么方法学习","你 用 什么 方法 学习")+ , ("AAA","AAA")+ , ("BBB","BBB")++ , ("习惯是第二天性", "习惯 是 第二 天性")+ , ("一切都会好的", "一切 都 会 好 的")+ , ("上帝什么都会", "上帝 什么 都 会")+ -- , ("他比我高一个头", "他 比 我 高 一 个 头") -- What's the right way to tokenize here?+ , ("每张桌子上都有菜单", "每 张 桌子 上 都 有 菜单") ]