public class CosineDistance extends Object implements EditDistance<Double>
It utilizes the
CosineSimilarity to compute the distance. Character sequences
are converted into vectors through a simple tokenizer that works with a regular expression
to split words in a sentence.
For further explanation about Cosine Similarity and Cosine Distance, refer to http://en.wikipedia.org/wiki/Cosine_similarity.
|Constructor and Description|
|Modifier and Type||Method and Description|
Compares two CharSequences.
public Double apply(CharSequence left, CharSequence right)
Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.