matches method

List<String> matches(
  1. Iterable<String> terms, {
  2. int limit = 10,
  3. int k = 2,
  4. double greaterThan = 0.10,
})

Returns the best matches for a term from terms, in descending order of term similarity (best match first).

The default greaterThan is 0.10. A higher value for greaterThan can improve performance as candidates with different lengths to this term are not evaluated, avoiding costly computation of edit distance and or Jaccard similarity.

Suggestions are returned in descending order of similarity.

The top returned matches will be limited to limit if more than limit matches are found.

Not case-sensitive.

Implementation

List<String> matches(Iterable<String> terms,
        {int limit = 10, int k = 2, double greaterThan = 0.10}) =>
    getSuggestions(terms, k: k, limit: limit, greaterThan: greaterThan)
        .where((element) => element.similarity > 0)
        .map((e) => e.term)
        .toList();