public class NGramDistance extends java.lang.Object implements StringDistance
| Constructor and Description |
|---|
NGramDistance()
Creates an N-Gram distance measure using n-grams of size 2.
|
NGramDistance(int size)
Creates an N-Gram distance measure using n-grams of the specified size.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
float |
getDistance(java.lang.String source,
java.lang.String target)
Returns a float between 0 and 1 based on how similar the specified strings are to one another.
|
int |
hashCode() |
java.lang.String |
toString() |
public NGramDistance(int size)
size - The size of the n-gram to be used to compute the string distance.public NGramDistance()
public float getDistance(java.lang.String source,
java.lang.String target)
StringDistancegetDistance in interface StringDistancesource - The first string.target - The second string.public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.ObjectData In Motion GmbH all rights reserved