JaroWinklerDistance (Lucene 2.4.1 API)
Keywords: org.apache.lucene.search.spell.JaroWinklerDistance 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 JaroWinklerDistance

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

All Implemented Interfaces:
  StringDistance

    public class JaroWinklerDistance

extends Object
implements StringDistance

Constructor Summary
`JaroWinklerDistance()`

Method Summary
`float` | `getDistance(String s1, String s2)` Returns a float between 0 and 1 based on how similar the specified strings are to one another.
`float` | `getThreshold()` Returns the current value of the threshold used for adding the Winkler bonus.
`void` | `setThreshold(float threshold)` Sets the threshold used to determine when Winkler bonus should be used.

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

Constructor Detail

### JaroWinklerDistance

    public JaroWinklerDistance()

Method Detail

### getDistance

    public float getDistance(String s1,
                             String s2)

  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:
    `s1` - The first string.
    `s2` - The second string.
  Returns:
    a float between 0 and 1 based on how similar the specified strings are to one another.

### setThreshold

    public void setThreshold(float threshold)

  Sets the threshold used to determine when Winkler bonus should be used. Set to a negative value to get the Jaro distance.

  Parameters:
    `threshold` - the new value of the threshold

### getThreshold

    public float getThreshold()

  Returns the current value of the threshold used for adding the Winkler bonus. The deafult value is 0.7.

  Returns:
    the current value of the threshold

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.