org.crosswire.common.diff
Class Distance

java.lang.Object
  extended by 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.
 
Method Summary
static int getLevenshteinDistance(String source, String target)
          Compute the LevenshteinDistance between two strings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Distance

private Distance()
Prevent instantiation.

Method Detail

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 text
target - the changed text
Returns:
the distance

Copyright ยจ 2003-2007