Safe Haskell | None |
---|---|
Language | Haskell2010 |
Parallel versions of filter
and simpleFilter
Documentation
:: Int | Chunk size. 1000 works well. |
-> Int | Max. number of results wanted |
-> Text | Pattern. |
-> [t] | The list of values containing the text to search in. |
-> (t -> Text) | The function to extract the text from the container. |
-> [Scored t] | The list of results, sorted, highest score first. |
The function to filter a list of values by fuzzy search on the text extracted from them.
:: Int | Chunk size. 1000 works well. |
-> Int | Max. number of results wanted |
-> Text | Pattern to look for. |
-> [Text] | List of texts to check. |
-> [Scored Text] | The ones that match. |
Return all elements of the list that have a fuzzy match against the pattern. Runs with default settings where nothing is added around the matches, as case insensitive.
>>>
simpleFilter "vm" ["vim", "emacs", "virtual machine"]
["vim","virtual machine"]
:: Text | Pattern in lowercase except for first character |
-> Text | The text to search in. |
-> Maybe Int | The score |
Returns the rendered output and the matching score for a pattern and a text. Two examples are given below:
>>>
match "fnt" "infinite"
Just 3
>>>
match "hsk" "Haskell"
Just 5