@Immutable public class NGram extends Object implements NormalizedStringDistance
Constructor and Description |
---|
NGram()
Instantiate with default value for n-gram length (2).
|
NGram(int n)
Instantiate with given value for n-gram length.
|
Modifier and Type | Method and Description |
---|---|
double |
distance(String s0,
String s1)
Compute n-gram distance.
|
public NGram(int n)
n
- public NGram()
public final double distance(String s0, String s1)
distance
in interface StringDistance
s0
- The first string to compare.s1
- The second string to compare.NullPointerException
- if s0 or s1 is null.Copyright © 2017. All rights reserved.