Operations
Automata operations.
Types
Properties
Default maximum effort that Operations.determinize should spend before giving up and throwing TooComplexToDeterminizeException.
Functions
Returns a (deterministic) automaton that accepts the complement of the language of the given automaton.
Returns an automaton that accepts the concatenation of the languages of the given automata.
Determinizes the given automaton.
Returns the longest string that is a prefix of all accepted strings and visits each state at most once. The automaton must not have dead states. If this automaton has already been converted to UTF-8 (e.g. using UTF32ToUTF8) then you should use .getCommonPrefixBytesRef instead.
Returns the longest BytesRef that is a prefix of all accepted strings and visits each state at most once.
Returns the longest BytesRef that is a suffix of all accepted strings. Worst case complexity: quadratic with number of states+transitions.
If this automaton accepts a single input, return it. Else, return null. The automaton must be deterministic.
Returns true if this automaton has any states that cannot be reached from the initial state or cannot reach an accept state. Cost is O(numTransitions+numStates).
Returns true if there are dead states reachable from an initial state.
Returns true if there are dead states that reach an accept state.
Returns an automaton that accepts the intersection of the languages of the given automata. Never modifies the input automata languages.
Merge all accept states that don't have outgoing transitions to a single shared state. This is a subset of minimization that is much cheaper. This helper is useful because operations like concatenation need to connect accept states of an automaton with the start state of the next one, so having fewer accept states makes the produced automata simpler.
Removes transitions to dead states (a state is "dead" if it is not reachable from the initial state or no accept state is reachable from it.)
Returns an automaton that accepts the Kleene star (zero or more concatenated repetitions) of the language of the given automaton. Never modifies the input automaton language.
Returns an automaton that accepts min or more concatenated repetitions of the language of the given automaton.
Returns an automaton that accepts between min and max (including both) concatenated repetitions of the language of the given automaton.
Returns true if the given string is accepted by the automaton. The input must be deterministic.
Returns true if the given string (expressed as unicode codepoints) is accepted by the automaton. The input must be deterministic.
Returns the topological sort of all states reachable from the initial state. This method assumes that the automaton does not contain cycles, and will throw an IllegalArgumentException if a cycle is detected. The CPU cost is O(numTransitions), and the implementation is non-recursive, so it will not exhaust the java stack for automaton matching long strings. If there are dead states in the automaton, they will be removed from the returned array.