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
- Host: GitHub
- URL: https://github.com/joom/fuzzy
- Owner: joom
- License: mit
- Created: 2015-07-24T20:08:56.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2024-01-05T18:30:32.000Z (over 2 years ago)
- Last Synced: 2024-04-26T01:21:08.008Z (about 2 years ago)
- Language: Haskell
- Size: 8.79 KB
- Stars: 14
- Watchers: 3
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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