LevensteinDistance (Lucene 2.4.1 API)
Keywords: org.apache.lucene.search.spell.LevensteinDistance class

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.apache.lucene.search.spell
Class LevensteinDistance

    java.lang.Object
      org.apache.lucene.search.spell.LevensteinDistance

All Implemented Interfaces:
  StringDistance

    public final class LevensteinDistance

extends Object
implements StringDistance

Levenshtein edit distance class.

Constructor Summary
`LevensteinDistance()` Optimized to run a bit faster than the static getDistance().

Method Summary
`float` | `getDistance(String target, String other)` Returns a float between 0 and 1 based on how similar the specified strings are to one another.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### LevensteinDistance

    public LevensteinDistance()

  Optimized to run a bit faster than the static getDistance(). In one benchmark times were 5.3sec using ctr vs 8.5sec w/ static method, thus 37% faster.

Method Detail

### getDistance

    public float getDistance(String target,
                             String other)

  Description copied from interface: `StringDistance`
  Returns a float between 0 and 1 based on how similar the specified strings are to one another. Returning a value of 0 means the specified strings are identical and 1 means the string are maximally different.

  Specified by:
    `getDistance` in interface `StringDistance`
  Parameters:
    `target` - The first string.
    `other` - The second string.
  Returns:
    a float between 0 and 1 based on how similar the specified strings are to one another.

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

Copyright © 2000-2009 Apache Software Foundation. All Rights Reserved.