getMatches function

List<PercentageMatch> getMatches (
  1. List<String> sentences,
  2. String toCheck,
  3. {bool ignoreArticles: false,
  4. bool matchCaseInsensitively: true,
  5. bool ignoreSpecialCharacters: true}
)

Returns percentages each sentence in sentences matched against toCheck.

Implementation

List<PercentageMatch> getMatches(List<String> sentences, String toCheck,
    {bool ignoreArticles = false,
    bool matchCaseInsensitively = true,
    bool ignoreSpecialCharacters = true}) {
  var matches = <PercentageMatch>[];
  for (var sentence in sentences) {
    matches.add(PercentageMatch(
        sentence,
        getPercentageMatched(sentence, toCheck,
            ignoreArticles: ignoreArticles,
            matchCaseInsensitively: matchCaseInsensitively,
            ignoreSpecialCharacters: ignoreSpecialCharacters)));
  }
  return matches;
}