matches static method

List<String> matches(
  1. String term,
  2. Iterable<String> terms, {
  3. int limit = 10,
  4. int k = 2,
  5. 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

static List<String> matches(String term, Iterable<String> terms,
        {int limit = 10, int k = 2, double greaterThan = 0.10}) =>
    term.matches(terms, k: k, limit: limit, greaterThan: greaterThan);