cndict 0.6.0 → 0.6.1
raw patch · 3 files changed
+9/−4 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- cndict.cabal +1/−1
- data/cedict_1_0_ts_utf-8_mdbg.txt too large to diff
- src/Data/Chinese/CCDict.hs +8/−3
cndict.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: cndict-version: 0.6.0+version: 0.6.1 synopsis: Chinese/Mandarin <-> English dictionary, Chinese lexer. -- description: license: PublicDomain
data/cedict_1_0_ts_utf-8_mdbg.txt view
file too large to diff
src/Data/Chinese/CCDict.hs view
@@ -331,6 +331,7 @@ -- union :: CCDict -> CCDict -> CCDict -- union = IntMap.unionWith joinTrie +-- joinTrie newValue oldValue joinTrie :: CCTrieEntry -> CCTrieEntry -> CCTrieEntry joinTrie (CCTrieNoEntry t1) (CCTrieNoEntry t2) = CCTrieNoEntry (IntMap.unionWith joinTrie t1 t2) joinTrie (CCTrieNoEntry t1) (CCTrieEntry e t2) = CCTrieEntry e (IntMap.unionWith joinTrie t1 t2)@@ -346,16 +347,20 @@ joinRawEntry :: RawEntry -> RawEntry -> RawEntry joinRawEntry e1 e2 = T.concat [e1, "\n", e2] +-- joinEntry newValue oldValue joinEntry :: Entry -> Entry -> Entry joinEntry e1 e2 = Entry- { entrySimplified = entrySimplified e1+ { -- The simplified characters must be identical+ entrySimplified = entrySimplified e1+ -- 了 maps to two traditional characters: 了 and 瞭.+ -- In these cases, choose the same as the simplified. , entryTraditional = if entryTraditional e1 == entrySimplified e1 || entryTraditional e2 == entrySimplified e1 then entrySimplified e1 else entryTraditional e1- , entryPinyin = entryPinyin e1 ++ entryPinyin e2- , entryDefinition = entryDefinition e1 ++ entryDefinition e2 }+ , entryPinyin = entryPinyin e2 ++ entryPinyin e1+ , entryDefinition = entryDefinition e2 ++ entryDefinition e1 } -- unions :: [CCDict] -> CCDict -- unions = foldl' union IntMap.empty