termSimilarityMap method Null safety
a hashmap of terms to termSimilarity with this term using a k-gram
length of k.
Implementation
Map<Term, double> termSimilarityMap(Iterable<Term> terms, [int k = 3]) {
final retVal = <Term, double>{};
final termGrams = kGrams(k);
for (final other in terms) {
retVal[other] =
_jaccardSimilarity(termGrams, other, k) * termSimilarity(other);
}
return retVal;
}