Module org.apache.lucene.core
Package org.apache.lucene.util.automaton
Class DaciukMihovAutomatonBuilder
- java.lang.Object
-
- org.apache.lucene.util.automaton.DaciukMihovAutomatonBuilder
-
@Deprecated public final class DaciukMihovAutomatonBuilder extends java.lang.Object
Deprecated.Visibility of this class will be reduced in a future release. Users can access this functionality directly throughAutomata.makeStringUnion(Iterable)
Builds a minimal, deterministicAutomaton
that accepts a set of strings. The algorithm requires sorted input data, but is very fast (nearly linear with the input size).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
DaciukMihovAutomatonBuilder.State
Deprecated.DFSA state withchar
labels on transitions.
-
Field Summary
Fields Modifier and Type Field Description static int
MAX_TERM_LENGTH
Deprecated.private BytesRefBuilder
previous
Deprecated.Used for input order checking (only through assertions right now)private DaciukMihovAutomatonBuilder.State
root
Deprecated.Root automaton state.private java.util.HashMap<DaciukMihovAutomatonBuilder.State,DaciukMihovAutomatonBuilder.State>
stateRegistry
Deprecated.A "registry" for state interning.
-
Constructor Summary
Constructors Modifier Constructor Description private
DaciukMihovAutomatonBuilder()
Deprecated.The default constructor is private.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description private void
add(BytesRef current, boolean asBinary)
Deprecated.static Automaton
build(java.lang.Iterable<BytesRef> input)
Deprecated.Please seeAutomata.makeStringUnion(Iterable)
instead(package private) static Automaton
build(java.lang.Iterable<BytesRef> input, boolean asBinary)
Deprecated.Build a minimal, deterministic automaton from a sorted list ofBytesRef
representing strings in UTF-8.(package private) static Automaton
build(BytesRefIterator input, boolean asBinary)
Deprecated.Build a minimal, deterministic automaton from a sorted list ofBytesRef
representing strings in UTF-8.private Automaton
completeAndConvert()
Deprecated.Called after adding all terms.private static int
convert(Automaton.Builder a, DaciukMihovAutomatonBuilder.State s, java.util.IdentityHashMap<DaciukMihovAutomatonBuilder.State,java.lang.Integer> visited)
Deprecated.Internal recursive traversal for conversion.private void
replaceOrRegister(DaciukMihovAutomatonBuilder.State state)
Deprecated.Replace last child ofstate
with an already registered state or stateRegistry the last child state.private boolean
setPrevious(BytesRef current)
Deprecated.Copycurrent
into an internal buffer.
-
-
-
Field Detail
-
MAX_TERM_LENGTH
@Deprecated public static final int MAX_TERM_LENGTH
Deprecated.This builder rejects terms that are more than 1k chars long since it then uses recursion based on the length of the string, which might cause stack overflows.- See Also:
- Constant Field Values
-
stateRegistry
private java.util.HashMap<DaciukMihovAutomatonBuilder.State,DaciukMihovAutomatonBuilder.State> stateRegistry
Deprecated.A "registry" for state interning.
-
root
private final DaciukMihovAutomatonBuilder.State root
Deprecated.Root automaton state.
-
previous
private BytesRefBuilder previous
Deprecated.Used for input order checking (only through assertions right now)
-
-
Method Detail
-
setPrevious
private boolean setPrevious(BytesRef current)
Deprecated.Copycurrent
into an internal buffer.
-
convert
private static int convert(Automaton.Builder a, DaciukMihovAutomatonBuilder.State s, java.util.IdentityHashMap<DaciukMihovAutomatonBuilder.State,java.lang.Integer> visited)
Deprecated.Internal recursive traversal for conversion.
-
completeAndConvert
private Automaton completeAndConvert()
Deprecated.Called after adding all terms. Performs final minimization and converts to a standardAutomaton
instance.
-
build
@Deprecated public static Automaton build(java.lang.Iterable<BytesRef> input)
Deprecated.Please seeAutomata.makeStringUnion(Iterable)
insteadBuild a minimal, deterministic automaton from a sorted list ofBytesRef
representing strings in UTF-8. These strings must be binary-sorted.
-
build
static Automaton build(java.lang.Iterable<BytesRef> input, boolean asBinary)
Deprecated.Build a minimal, deterministic automaton from a sorted list ofBytesRef
representing strings in UTF-8. These strings must be binary-sorted.
-
build
static Automaton build(BytesRefIterator input, boolean asBinary) throws java.io.IOException
Deprecated.Build a minimal, deterministic automaton from a sorted list ofBytesRef
representing strings in UTF-8. These strings must be binary-sorted. Creates anAutomaton
with either UTF-8 codepoints as transition labels or binary (compiled) transition labels based onasBinary
.- Throws:
java.io.IOException
-
add
private void add(BytesRef current, boolean asBinary)
Deprecated.
-
replaceOrRegister
private void replaceOrRegister(DaciukMihovAutomatonBuilder.State state)
Deprecated.Replace last child ofstate
with an already registered state or stateRegistry the last child state.
-
-