Class LuceneLevenshteinDistance
Damerau-Levenshtein (optimal string alignment) implemented in a consistent way as Lucene's FuzzyTermsEnum with the transpositions option enabled.
Notes:
- This metric treats full unicode codepoints as characters
- This metric scales raw edit distances into a floating point score based upon the shortest of the two terms
- Transpositions of two adjacent codepoints are treated as primitive edits.
- Edits are applied in parallel: for example, "ab" and "bca" have distance 3.
NOTE: this class is not particularly efficient. It is only intended for merging results from multiple DirectSpellCheckers.
Inheritance
System.Object
LuceneLevenshteinDistance
Implements
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Lucene.Net.Search.Spell
Assembly: Lucene.Net.Suggest.dll
Syntax
public sealed class LuceneLevenshteinDistance : IStringDistance
Constructors
| Improve this Doc View SourceLuceneLevenshteinDistance()
Creates a new comparer, mimicing the behavior of Lucene's internal edit distance.
Declaration
public LuceneLevenshteinDistance()
Methods
| Improve this Doc View SourceGetDistance(String, String)
Declaration
public float GetDistance(string target, string other)
Parameters
Type | Name | Description |
---|---|---|
System.String | target | |
System.String | other |
Returns
Type | Description |
---|---|
System.Single |