Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/laserpants/fuzzyset-haskell
:sheep: A fuzzy string set implementation in Haskell.
https://github.com/laserpants/fuzzyset-haskell
fuzzy-matching haskell search string
Last synced: about 2 months ago
JSON representation
:sheep: A fuzzy string set implementation in Haskell.
- Host: GitHub
- URL: https://github.com/laserpants/fuzzyset-haskell
- Owner: laserpants
- License: bsd-3-clause
- Created: 2017-09-24T21:34:42.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2024-03-08T03:13:11.000Z (10 months ago)
- Last Synced: 2024-10-13T00:47:30.262Z (2 months ago)
- Topics: fuzzy-matching, haskell, search, string
- Language: Haskell
- Homepage: http://hackage.haskell.org/package/fuzzyset
- Size: 207 KB
- Stars: 9
- Watchers: 2
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# fuzzyset-haskell
[![Haskell CI](https://github.com/laserpants/fuzzyset-haskell/actions/workflows/haskell.yml/badge.svg)](https://github.com/laserpants/fuzzyset-haskell/actions/workflows/haskell.yml)
[![License](https://img.shields.io/badge/license-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
[![Language](https://img.shields.io/badge/language-Haskell-yellow.svg)](https://www.haskell.org/)
[![Hackage](https://img.shields.io/hackage/v/fuzzyset.svg)](http://hackage.haskell.org/package/fuzzyset)A fuzzy string set data structure for approximate string matching.
In a nutshell:
1. Add data to the set (see `add`, `add_`, `addMany`, and `addMany_`)
2. Query the set (see `find`, `findMin`, `findOne`, `findOneMin`, `closestMatchMin`, and `closestMatch`)Refer to the [Haddock docs](http://hackage.haskell.org/package/fuzzyset) for details.
## Example
```haskell
{-# 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 = closestMatchprog :: FuzzySearchT IO ()
prog = do
add_ "Jurassic Park"
add_ "Terminator"
add_ "The Matrix"
result <- findMovie "The Percolator"
lift (print result)main :: IO ()
main = runDefaultFuzzySearchT prog
```