Module org.apache.lucene.core
Package org.apache.lucene.util.automaton
Class LevenshteinAutomata.ParametricDescription
java.lang.Object
org.apache.lucene.util.automaton.LevenshteinAutomata.ParametricDescription
- Direct Known Subclasses:
Lev1ParametricDescription,Lev1TParametricDescription,Lev2ParametricDescription,Lev2TParametricDescription
- Enclosing class:
LevenshteinAutomata
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:
- The number of states:
size() - The set of final states:
isAccept(int) - The transition function:
transition(int, int, int) - Minimal boundary function:
getPosition(int)
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) intgetPosition(int absState) Returns the position in the input word for a givenstate.(package private) booleanisAccept(int absState) Returns true if thestatein any Levenshtein DFA is an accept state (final state).(package private) intsize()Return the number of states needed to compute a Levenshtein DFA(package private) abstract inttransition(int state, int position, int vector) Returns the state number for a transition from the givenstate, assumingpositionand characteristic vectorvectorprotected intunpack(long[] data, int index, int bitsPerValue)
-
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 thestatein any Levenshtein DFA is an accept state (final state). -
getPosition
int getPosition(int absState) Returns the position in the input word for a givenstate. 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 givenstate, assumingpositionand characteristic vectorvector -
unpack
protected int unpack(long[] data, int index, int bitsPerValue)
-