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
otherusing ak-gram length ofk. -
jaccardSimilarityMap(
Iterable< Term> terms, [int k = 3]) → Map<Term, double> -
Returns a hashmap of
termsto Jaccard Similarity Index with this term using ak-gram length ofk. -
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
otheron a log (base 2) scale: -
lengthSimilarity(
Term other) → double -
Returns the similarity in length between this string and
otherwhere: lengthSimilarity = 1 - lengthDistance. -
lengthSimilarityMap(
Iterable< Term> terms) → Map<Term, double> -
Returns a hashmap of
termsto their lengthSimilarity with this. -
matches(
Iterable< Term> terms, {int k = 3, int limit = 10}) → List<Term> -
Returns the best matches for the
Termfromterms, 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
termsto termSimilarity with this term using ak-gram length ofk.