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 String
Returns the longest string that is a prefix of all accepted strings and visits each state at most once.static BytesRef
static String
Returns the longest string that is a suffix of all accepted strings and visits each state at most once.static BytesRef
getFiniteStrings
(Automaton a, int limit) Returns the set of accepted strings, assuming that at mostlimit
strings are accepted.static boolean
Returns 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 mostlimit
strings are accepted. If more thanlimit
strings are accepted, the first limit strings found are returned. Iflimit
<0, then the limit is infinite.
-