84 more words from HSK in DictionaryChi. Now it covers almost all characters that appear in the HSK. The missing ones are used in words that are not in Dictionary abstract syntax.

This commit is contained in:
aarne
2014-09-30 16:31:12 +00:00
parent 0bdd599972
commit 20d2d10866
3 changed files with 108 additions and 90 deletions

View File

@@ -45,7 +45,7 @@ mergeDict old new comm file = do
appendFile file "}"
data Rule = R {fun :: String, priority :: Int, lins :: [[String]], comment :: [String]} -- fun, variants, comment
deriving (Eq,Ord)
deriving (Eq,Ord,Show)
mkRule :: Int -> [String] -> Rule
mkRule i ws = case ws of
@@ -66,6 +66,7 @@ mergeRule :: Maybe String -> [Rule] -> Rule
mergeRule mco rs = case rs of
[r] -> r
[old,new] -> R (fun old) 0 (mergeLin (lins old) (lins new)) (comment old ++ comment new)
_ -> error $ show rs
where
mergeLin old new = olds ++ case filter (flip notElem old) new of
l:ls -> case mco of