fuzzywuzzy library

Functions

extractAll<T>({required String query, required List<T> choices, int cutoff = 0, Applicable ratio = const WeightedRatio(), String getter(T obj)?}) List<ExtractedResult<T>>
Creates a list of ExtractedResult which contains all the choices with their corresponding score where higher is more similar. Uses WeightedRatio as the default algorithm getter is optional for String types, but MUST NOT be null for any other types
extractAllSorted<T>({required String query, required List<T> choices, int cutoff = 0, Applicable ratio = const WeightedRatio(), String getter(T obj)?}) List<ExtractedResult<T>>
Returns a sorted list of ExtractedResult without any cutoffs. Uses WeightedRatio as the default algorithm. getter is optional for String types, but MUST NOT be null for any other types
extractOne<T>({required String query, required List<T> choices, int cutoff = 0, Applicable ratio = const WeightedRatio(), String getter(T obj)?}) ExtractedResult<T>
Find the single best match above the cutoff in a list of choices. getter is optional for String types, but MUST NOT be null for any other types
extractTop<T>({required String query, required List<T> choices, required int limit, int cutoff = 0, Applicable ratio = const WeightedRatio(), String getter(T obj)?}) List<ExtractedResult<T>>
Returns a sorted list of ExtractedResult which contains the top limit most similar choices. Will reject any items with scores below the cutoff. Default cutoff is 0. Uses WeightedRatio as the default algorithm. getter is optional for String types, but MUST NOT be null for any other types
partialRatio(String s1, String s2) int
Inconsistent substrings lead to problems in matching. This ratio uses a heuristic called "best partial" for when two strings are of noticeably different lengths.
ratio(String s1, String s2) int
Calculates a Levenshtein simple ratio between the strings This indicates a measure of similarity
tokenSetPartialRatio(String s1, String s2) int
Splits the strings into tokens and computes intersections and remainders between the tokens of the two strings. A comparison string is then built up and is compared using the partial ratio algorithm. Useful for strings where words appear redundantly.
tokenSetRatio(String s1, String s2) int
Splits the strings into tokens and computes intersections and remainders between the tokens of the two strings. A comparison string is then built up and is compared using the simple ratio algorithm. Useful for strings where words appear redundantly.
tokenSortPartialRatio(String s1, String s2) int
Find all alphanumeric tokens in the string and sort these tokens and then take partial ratio of resulting joined strings.
tokenSortRatio(String s1, String s2) int
Find all alphanumeric tokens in the string and sort these tokens and then take ratio of resulting joined strings.
weightedRatio(String s1, String s2) int
Calculates a weighted ratio between s1 and s2 using the best option from the above fuzzy matching algorithms