TextAnalysisExtension extension Null safety

Extension methods on Term.

on

Methods

jaccardSimilarity(Term other, [int k = 3]) double
Returns the Jaccard Similarity Index between this term and other using a k-gram length of k.
jaccardSimilarityMap(Iterable<Term> terms, [int k = 3]) Map<Term, double>
Returns a hashmap of terms to Jaccard Similarity Index with this term using a k-gram length of k.
kGrams([int k = 3]) Set<KGram>
Returns a set of k-grams in the term.
lengthDistance(Term other) double
Returns a normalized measure of difference between this Term and other on a log (base 2) scale:
lengthSimilarity(Term other) double
Returns the similarity in length between this string and other where: lengthSimilarity = 1 - lengthDistance.
lengthSimilarityMap(Iterable<Term> terms) Map<Term, double>
Returns a hashmap of terms to their lengthSimilarity with this.
matches(Iterable<Term> terms, {int k = 3, int limit = 10}) List<Term>
Returns the best matches for the Term from terms, in descending order of termSimilarity (best match first).
termSimilarity(Term other, [int k = 3]) double
Returns a similarity index value between 0.0 and 1.0, defined as the product of jaccardSimilarity and lengthSimilarity.
termSimilarityMap(Iterable<Term> terms, [int k = 3]) Map<Term, double>
a hashmap of terms to termSimilarity with this term using a k-gram length of k.