Fork me on GitHub
  • API

    Show / Hide Table of Contents

    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
    object
    LevenshteinAutomata
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Lucene.Net.Util.Automaton
    Assembly: Lucene.Net.dll
    Syntax
    public class LevenshteinAutomata

    Constructors

    LevenshteinAutomata(int[], int, bool)

    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
    int[] word
    int alphaMax
    bool withTranspositions

    LevenshteinAutomata(string, bool)

    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
    string input
    bool withTranspositions

    Fields

    MAXIMUM_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
    int

    Methods

    ToAutomaton(int)

    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
    int n
    Returns
    Type Description
    Automaton
    Back to top Copyright © 2024 The Apache Software Foundation, Licensed under the Apache License, Version 2.0
    Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation.
    All other marks mentioned may be trademarks or registered trademarks of their respective owners.