cndict 0.2.4 → 0.2.5
raw patch · 2 files changed
+7/−4 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- cndict.cabal +1/−1
- src/Data/Chinese/CCDict.hs +6/−3
cndict.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: cndict-version: 0.2.4+version: 0.2.5 synopsis: Chinese/Mandarin <-> English dictionary, Chinese lexer. -- description: license: PublicDomain
src/Data/Chinese/CCDict.hs view
@@ -150,6 +150,8 @@ , ("这位子", ["这","位子"]) , ("十分钟", ["十","分钟"]) , ("有电梯", ["有","电梯"])+ , ("中午前", ["中午","前"])+ -- , ("得很", ["得","很"]) -- Don't know how to fix this. -- , ("家中餐馆", ["家","中餐馆"]) -- tokenizer needs to be more greedy to correctly -- deal with this input. , ("后生活", ["后","生活"])@@ -180,13 +182,14 @@ Nothing -> [] Just (Node entries rest,_score) -> entries ++ collapseNonDet rest where- assocs = [ (node, nodeSum node)+ geoMean [] = 0+ geoMean n = round (fromIntegral (product n)**(recip (fromIntegral (length n))))+ assocs = [ (node, geoMean (filter (/=0) (nodeSum node))) | node <- forest ] wordCount word = maybe 0 subtlexWCount (M.lookup word subtlex) entryCount (KnownWord entry) = wordCount (entryChinese entry) entryCount UnknownWord{} = 0- entriesSum = sum . map entryCount- nodeSum (Node entries _) = entriesSum entries+ nodeSum (Node entries _) = map entryCount entries -- Enhanced tokenizer, mixed non-determistic and greedy algorithm tokenizer' :: CCDict -> Text -> [Token]