Skip to content

joom/fuzzy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Fuzzy string search in Haskell

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published