An open API service indexing awesome lists of open source software.

https://github.com/joom/fuzzy

Fuzzy string search in Haskell
https://github.com/joom/fuzzy

Last synced: about 1 year ago
JSON representation

Fuzzy string search in Haskell

Awesome Lists containing this project

README

          

# fuzzy

Fuzzy string search library in Haskell. Uses `TextualMonoid`
from [monoid-subclasses](https://hackage.haskell.org/package/monoid-subclasses)
to be able to run on different types of strings.

Ported from the JavaScript equivalent [mattyork/fuzzy](https://github.com/mattyork/fuzzy).

## Installation

```
cabal install fuzzy
```

## Usage

```haskell

> import Text.Fuzzy

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

> match "hsk" ("Haskell",1995) "<" ">" fst False
Just ("aell",5)

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

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

> test "brd" "bread"
True
```

## License

MIT