Package org.apache.lucene.util.automaton
Class BasicAutomata
java.lang.Object
org.apache.lucene.util.automaton.BasicAutomata
Construction of basic automata.
-
Method Summary
Modifier and TypeMethodDescriptionstatic AutomatonReturns a new (deterministic) automaton that accepts any single codepoint.static AutomatonReturns a new (deterministic) automaton that accepts all strings.static AutomatonmakeChar(int c) Returns a new (deterministic) automaton that accepts a single codepoint of the given value.static AutomatonmakeCharRange(int min, int max) Returns a new (deterministic) automaton that accepts a single codepoint whose value is in the given interval (including both end points).static AutomatonReturns a new (deterministic) automaton with the empty language.static AutomatonReturns a new (deterministic) automaton that accepts only the empty string.static AutomatonmakeInterval(int min, int max, int digits) Returns a new automaton that accepts strings representing decimal non-negative integers in the given interval.static AutomatonmakeString(int[] word, int offset, int length) static AutomatonmakeString(String s) Returns a new (deterministic) automaton that accepts the single given string.static AutomatonmakeStringUnion(Collection<BytesRef> utf8Strings) Returns a new (deterministic and minimal) automaton that accepts the union of the given collection ofBytesRefs representing UTF-8 encoded strings.
-
Method Details
-
makeEmpty
Returns a new (deterministic) automaton with the empty language. -
makeEmptyString
Returns a new (deterministic) automaton that accepts only the empty string. -
makeAnyString
Returns a new (deterministic) automaton that accepts all strings. -
makeAnyChar
Returns a new (deterministic) automaton that accepts any single codepoint. -
makeChar
Returns a new (deterministic) automaton that accepts a single codepoint of the given value. -
makeCharRange
Returns a new (deterministic) automaton that accepts a single codepoint whose value is in the given interval (including both end points). -
makeInterval
Returns a new automaton that accepts strings representing decimal non-negative integers in the given interval.- Parameters:
min- minimal value of intervalmax- maximal value of interval (both end points are included in the interval)digits- if >0, use fixed number of digits (strings must be prefixed by 0's to obtain the right length) - otherwise, the number of digits is not fixed- Throws:
IllegalArgumentException- if min>max or if numbers in the interval cannot be expressed with the given fixed number of digits
-
makeString
Returns a new (deterministic) automaton that accepts the single given string. -
makeString
-
makeStringUnion
Returns a new (deterministic and minimal) automaton that accepts the union of the given collection ofBytesRefs representing UTF-8 encoded strings.- Parameters:
utf8Strings- The input strings, UTF-8 encoded. The collection must be in sorted order.- Returns:
- An
Automatonaccepting all input strings. The resulting automaton is codepoint based (full unicode codepoints on transitions).
-