@hackage fuzzyset0.3.2
Fuzzy set data structure for approximate string matching
Categories
License
BSD-3-Clause
Maintainer
hildenjohannes@gmail.com
Links
Versions
Installation
Dependencies (7)
- base >=4.7 && <5
- mtl >=2.2.2 && <2.5
- text >=2.0.2 && <2.2
- text-metrics >=0.3.2 && <0.5
- transformers >=0.5.6.2 && <0.8
- unordered-containers >=0.2.19.1 && <0.4 Show all…
Dependents (1)
@hackage/acme-everything
fuzzyset-haskell
A fuzzy string set data structure for approximate string matching.
In a nutshell:
- Add data to the set (see
add,add_,addMany, andaddMany_) - Query the set (see
find,findMin,findOne,findOneMin,closestMatchMin, andclosestMatch)
Refer to the Haddock docs for details.
Example
{-# LANGUAGE OverloadedStrings #-}
module Main where ```
import Control.Monad.Trans.Class (lift)
import Data.Text (Text)
import Data.FuzzySet (FuzzySearchT, add_, closestMatch, runDefaultFuzzySearchT)
findMovie :: Text -> FuzzySearchT IO (Maybe Text)
findMovie = closestMatch
prog :: FuzzySearchT IO ()
prog = do
add_ "Jurassic Park"
add_ "Terminator"
add_ "The Matrix"
result <- findMovie "The Percolator"
lift (print result)
main :: IO ()
main = runDefaultFuzzySearchT prog