Package org.apache.lucene.util.automaton
Class SpecialOperations
- java.lang.Object
-
- org.apache.lucene.util.automaton.SpecialOperations
-
public final class SpecialOperations extends java.lang.ObjectSpecial automata operations.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringgetCommonPrefix(Automaton a)Returns the longest string that is a prefix of all accepted strings and visits each state at most once.static BytesRefgetCommonPrefixBytesRef(Automaton a)static java.lang.StringgetCommonSuffix(Automaton a)Returns the longest string that is a suffix of all accepted strings and visits each state at most once.static BytesRefgetCommonSuffixBytesRef(Automaton a)static java.util.Set<IntsRef>getFiniteStrings(Automaton a, int limit)Returns the set of accepted strings, assuming that at mostlimitstrings are accepted.static booleanisFinite(Automaton a)Returns true if the language of this automaton is finite.static java.util.Set<State>reverse(Automaton a)Reverses the language of the given (non-singleton) automaton while returning the set of new initial states.
-
-
-
Method Detail
-
isFinite
public static boolean isFinite(Automaton a)
Returns true if the language of this automaton is finite.
-
getCommonPrefix
public static java.lang.String getCommonPrefix(Automaton a)
Returns the longest string that is a prefix of all accepted strings and visits each state at most once.- Returns:
- common prefix
-
getCommonSuffix
public static java.lang.String getCommonSuffix(Automaton a)
Returns the longest string that is a suffix of all accepted strings and visits each state at most once.- Returns:
- common suffix
-
reverse
public static java.util.Set<State> reverse(Automaton a)
Reverses the language of the given (non-singleton) automaton while returning the set of new initial states.
-
getFiniteStrings
public static java.util.Set<IntsRef> getFiniteStrings(Automaton a, int limit)
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.
-
-