moan 0.2.0.1 → 0.2.0.2
raw patch · 2 files changed
+7/−3 lines, 2 files
Files
- moan.cabal +1/−1
- src/NLP/Morphosyntax/Analyzer.hs +6/−2
moan.cabal view
@@ -1,5 +1,5 @@ name: moan-version: 0.2.0.1+version: 0.2.0.2 synopsis: Language-agnostic analyzer for positional morphosyntactic tags description: Implementation of a space-efficient morphosyntactic analyzer. It solves a problem of providing a set of possible tags for a given word.
src/NLP/Morphosyntax/Analyzer.hs view
@@ -58,6 +58,7 @@ , save , load , create+, emptyConf -- * Token matching , Matcher(..) -- * Configuration@@ -95,7 +96,7 @@ modelVersion :: String-modelVersion = "0.2.0.0"+modelVersion = "0.2.0.2" -- | Replaces the need of writing regular expressions for simple matching. -- Matching on punctuation, number, alphanumeric, upper-case tokens or@@ -220,9 +221,12 @@ put csl get = do comp <- get- when (comp /= modelVersion) $ error $+ let (x1:y1:_) = words $ map (\x -> if x == '.' then ' ' else x) comp+ let (x2:y2:_) = words $ map (\x -> if x == '.' then ' ' else x) modelVersion+ when (x1 /= x2 || y1 /= y2) $ error $ "Incompatible analyzer code version: " ++ comp ++ ", expected: " ++ modelVersion+ -- ^^ Models will be compatible if they match in the first two version numbers Analyzer <$> get <*> get <*> get <*> get <*> get -- | Gives back a set of 'P.Tag' given the indices.