Package org.apache.lucene.util.automaton
Class SpecialOperations
java.lang.Object
org.apache.lucene.util.automaton.SpecialOperations
Special automata operations.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringReturns the longest string that is a prefix of all accepted strings and visits each state at most once.static BytesRefstatic StringReturns the longest string that is a suffix of all accepted strings and visits each state at most once.static BytesRefgetFiniteStrings(Automaton a, int limit) Returns the set of accepted strings, assuming that at mostlimitstrings are accepted.static booleanReturns true if the language of this automaton is finite.Reverses the language of the given (non-singleton) automaton while returning the set of new initial states.
-
Method Details
-
isFinite
Returns true if the language of this automaton is finite. -
getCommonPrefix
Returns the longest string that is a prefix of all accepted strings and visits each state at most once.- Returns:
- common prefix
-
getCommonPrefixBytesRef
-
getCommonSuffix
Returns the longest string that is a suffix of all accepted strings and visits each state at most once.- Returns:
- common suffix
-
getCommonSuffixBytesRef
-
reverse
Reverses the language of the given (non-singleton) automaton while returning the set of new initial states. -
getFiniteStrings
Returns the set of accepted strings, assuming that at mostlimitstrings are accepted. If more thanlimitstrings are accepted, the first limit strings found are returned. Iflimit<0, then the limit is infinite.
-