Class LevenshteinAutomata.ParametricDescription

java.lang.Object
org.apache.lucene.util.automaton.LevenshteinAutomata.ParametricDescription
Direct Known Subclasses:
Lev1ParametricDescription, Lev1TParametricDescription, Lev2ParametricDescription, Lev2TParametricDescription
Enclosing class:
LevenshteinAutomata

abstract static class LevenshteinAutomata.ParametricDescription extends Object
A ParametricDescription describes the structure of a Levenshtein DFA for some degree n.

There are four components of a parametric description, all parameterized on the length of the word w:

  1. The number of states: size()
  2. The set of final states: isAccept(int)
  3. The transition function: transition(int, int, int)
  4. Minimal boundary function: getPosition(int)
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final long[]
     
    private final int[]
     
    protected final int
     
    protected final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    ParametricDescription(int w, int n, int[] minErrors)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) int
    getPosition(int absState)
    Returns the position in the input word for a given state.
    (package private) boolean
    isAccept(int absState)
    Returns true if the state in any Levenshtein DFA is an accept state (final state).
    (package private) int
    Return the number of states needed to compute a Levenshtein DFA
    (package private) abstract int
    transition(int state, int position, int vector)
    Returns the state number for a transition from the given state, assuming position and characteristic vector vector
    protected int
    unpack(long[] data, int index, int bitsPerValue)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • w

      protected final int w
    • n

      protected final int n
    • minErrors

      private final int[] minErrors
    • MASKS

      private static final long[] MASKS
  • Constructor Details

    • ParametricDescription

      ParametricDescription(int w, int n, int[] minErrors)
  • Method Details

    • size

      int size()
      Return the number of states needed to compute a Levenshtein DFA
    • isAccept

      boolean isAccept(int absState)
      Returns true if the state in any Levenshtein DFA is an accept state (final state).
    • getPosition

      int getPosition(int absState)
      Returns the position in the input word for a given state. This is the minimal boundary for the state.
    • transition

      abstract int transition(int state, int position, int vector)
      Returns the state number for a transition from the given state, assuming position and characteristic vector vector
    • unpack

      protected int unpack(long[] data, int index, int bitsPerValue)