KGramParserExtension extension Null safety

Extension methods on Term.

on
  • Term

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 if lengthDistance.
lengthSimilarityMap(Iterable<Term> terms) Map<Term, double>
Returns a hashmap of terms to their lengthSimilarity with this.