Class JaroWinklerDistance
Similarity measure for short strings such as person names. See http://en.wikipedia.org/wiki/Jaro%E2%80%93Winkler_distance
Implements
Inherited Members
Namespace: Lucene.Net.Search.Spell
Assembly: Lucene.Net.Suggest.dll
Syntax
public class JaroWinklerDistance : IStringDistance
Constructors
JaroWinklerDistance()
Creates a new distance metric with the default threshold for the Jaro Winkler bonus (0.7)
Declaration
public JaroWinklerDistance()
See Also
Properties
Threshold
Gets or sets the threshold used to determine when Winkler bonus should be used. The default value is 0.7. Set to a negative value to get the Jaro distance.
Declaration
public virtual float Threshold { get; set; }
Property Value
Type | Description |
---|---|
float |
Methods
Equals(object)
Determines whether the specified object is equal to the current object.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | The object to compare with the current object. |
Returns
Type | Description |
---|---|
bool | true if the specified object is equal to the current object; otherwise, false. |
Overrides
GetDistance(string, string)
Returns a float between 0 and 1 based on how similar the specified strings are to one another.
Returning a value of 1 means the specified strings are identical and 0 means the
string are maximally different.
Declaration
public virtual float GetDistance(string s1, string s2)
Parameters
Type | Name | Description |
---|---|---|
string | s1 | The first string. |
string | s2 | The second string. |
Returns
Type | Description |
---|---|
float | a float between 0 and 1 based on how similar the specified strings are to one another. |
GetHashCode()
Serves as the default hash function.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | A hash code for the current object. |
Overrides
ToString()
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | A string that represents the current object. |