ac-machine 0.2.0.1 → 0.2.0.2
raw patch · 2 files changed
+3/−3 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- Data/AhoCorasick.hs +2/−2
- ac-machine.cabal +1/−1
Data/AhoCorasick.hs view
@@ -93,11 +93,11 @@ buildOutput :: (Eq a, Hashable a) => [([a], v)] -> GotoMap a -> FailureMap -> OutputMap v buildOutput pvs gotoMap failureMap = foldl' build o0 $ tail $ toBFList gotoMap where- build o s = foldl' (\a (_, s') -> Map.insertWith (flip (++)) s' (lookupDefault [] (failure s') a) a) o ts+ build o s = foldl' (\a (_, s') -> let vs = lookupDefault [] (failure s') a in vs `seq` Map.insertWith (flip (++)) s' vs a) o ts where ts = Map.toList $ lookupDefault Map.empty s gotoMap failure = fromMaybe (error "failure: ") . flip Map.lookup failureMap- o0 = Map.fromList $ fromJust $ mapM toKV pvs+ o0 = Map.fromList $ map (fromJust . toKV) pvs toKV (p, v) = do s <- finalState gotoMap root p return (s, [(length p, v)])
ac-machine.cabal view
@@ -1,5 +1,5 @@ name: ac-machine-version: 0.2.0.1+version: 0.2.0.2 synopsis: Aho-Corasick string matching algorithm in Haskell description: An implementation of the Aho-Corasick string matching algorithm written in Haskell. license: BSD3