org.crosswire.common.diff
Class Distance
java.lang.Object
org.crosswire.common.diff.Distance
public class Distance
- extends Object
Compute the distance between 2 strings. The larger the number the greater the distance.
- Author:
- DM Smith [dmsmith555 at yahoo dot com]
- See Also:
for license details.
The copyright to this program is held by it's authors.
Constructor Summary |
private |
Distance()
Prevent instantiation. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Distance
private Distance()
- Prevent instantiation.
getLevenshteinDistance
public static int getLevenshteinDistance(String source,
String target)
- Compute the LevenshteinDistance between two strings.
See www.merriampark.com/ldjava.htm for original implementation.
- Parameters:
source
- the baseline texttarget
- the changed text
- Returns:
- the distance