All Projects → joom → Fuzzy

joom / Fuzzy

Licence: mit
Fuzzy string search in Haskell

Programming Languages

haskell
3896 projects

fuzzy

Fuzzy string search library in Haskell. Uses TextualMonoid from monoid-subclasses to be able to run on different types of strings.

Ported from the JavaScript equivalent mattyork/fuzzy.

Installation

cabal install fuzzy

Usage

> import Text.Fuzzy

> match "fnt" "infinite" "" "" id True
Just ("infinite",3)

> match "hsk" ("Haskell",1995) "<" ">" fst False
Just ("<h>a<s><k>ell",5)

> filter "ML" [("Standard ML", 1990),("OCaml",1996),("Scala",2003)] "<" ">" fst False
[Fuzzy {original = ("Standard ML",1990), rendered = "standard <m><l>", score = 4},Fuzzy {original = ("OCaml",1996), rendered = "oca<m><l>", score = 4}]

> simpleFilter "vm" ["vim", "emacs", "virtual machine"]
["vim","virtual machine"]

> test "brd" "bread"
True

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].