@Immutable public final class OptimalStringAlignment extends Object implements StringDistance
| Constructor and Description |
|---|
OptimalStringAlignment() |
| Modifier and Type | Method and Description |
|---|---|
double |
distance(String s1,
String s2)
Compute the distance between strings: the minimum number of operations
needed to transform one string into the other (insertion, deletion,
substitution of a single character, or a transposition of two adjacent
characters) while no substring is edited more than once.
|
public final double distance(String s1, String s2)
distance in interface StringDistances1 - The first string to compare.s2 - The second string to compare.NullPointerException - if s1 or s2 is null.Copyright © 2017. All rights reserved.