Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.crosswire.common.diff
Class Distance

    java.lang.Object
      org.crosswire.common.diff.Distance

    public final class Distance

extends Object

Compute the distance between 2 strings. The larger the number the greater the distance.

Author:
  DM Smith
See Also:
  `The GNU Lesser General Public License for details.`

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

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Copyright ¨ 2003-2015
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD