Class LevenshteinAutomata
Class to construct DFAs that match a word within some edit distance.
Implements the algorithm described in: Schulz and Mihov: Fast String Correction with Levenshtein Automata
Note
This API is experimental and might change in incompatible ways in the next release.
Inheritance
System.Object
LevenshteinAutomata
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.Util.Automaton
Assembly: Lucene.Net.dll
Syntax
public class LevenshteinAutomata
Constructors
| Improve this Doc View SourceLevenshteinAutomata(Int32[], Int32, Boolean)
Expert: specify a custom maximum possible symbol (alphaMax); default is J2N.Character.MaxCodePoint.
Declaration
public LevenshteinAutomata(int[] word, int alphaMax, bool withTranspositions)
Parameters
Type | Name | Description |
---|---|---|
System.Int32[] | word | |
System.Int32 | alphaMax | |
System.Boolean | withTranspositions |
LevenshteinAutomata(String, Boolean)
Create a new LevenshteinAutomata for some input
string.
Optionally count transpositions as a primitive edit.
Declaration
public LevenshteinAutomata(string input, bool withTranspositions)
Parameters
Type | Name | Description |
---|---|---|
System.String | input | |
System.Boolean | withTranspositions |
Fields
| Improve this Doc View SourceMAXIMUM_SUPPORTED_DISTANCE
Note
This API is for internal purposes only and might change in incompatible ways in the next release.
Declaration
public const int MAXIMUM_SUPPORTED_DISTANCE = 2
Field Value
Type | Description |
---|---|
System.Int32 |
Methods
| Improve this Doc View SourceToAutomaton(Int32)
Compute a DFA that accepts all strings within an edit distance of n
.
All automata have the following properties:
- They are deterministic (DFA).
- There are no transitions to dead states.
- They are not minimal (some transitions could be combined).
Declaration
public virtual Automaton ToAutomaton(int n)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | n |
Returns
Type | Description |
---|---|
Automaton |