string/fuzzy_search_utils library

Fuzzy search over list of strings with token + edit distance + ranking (roadmap #406).

Classes

FuzzySearchUtils
One candidate from fuzzy search with score and matched text.

Functions

fuzzySearch(String query, List<String> candidates, {int maxDistance = 2, double minScore = 0.0}) List<FuzzySearchUtils>
Searches candidates for query; returns matches sorted by match score descending.
partialRatio(String a, String b) double
fuzzywuzzy-style partial ratio: how well the shorter string matches the best-aligning slice of the longer one, in [0, 1].
tokenSetRatio(String a, String b) double
fuzzywuzzy-style token-set ratio: the best ratio over the shared tokens and each side's remainder, in [0, 1].
tokenSortRatio(String a, String b) double
fuzzywuzzy-style token-sort ratio: ratio after each string's tokens are lowercased, sorted, and rejoined, in [0, 1].