public final class SpecialOperations extends Object
Modifier and Type | Method and Description |
---|---|
static String |
getCommonPrefix(Automaton a)
Returns the longest string that is a prefix of all accepted strings and
visits each state at most once.
|
static BytesRef |
getCommonPrefixBytesRef(Automaton a) |
static String |
getCommonSuffix(Automaton a)
Returns the longest string that is a suffix of all accepted strings and
visits each state at most once.
|
static BytesRef |
getCommonSuffixBytesRef(Automaton a) |
static Set<IntsRef> |
getFiniteStrings(Automaton a,
int limit)
Returns the set of accepted strings, up to at most
limit strings. |
static boolean |
isFinite(Automaton a)
Returns true if the language of this automaton is finite.
|
static Set<State> |
reverse(Automaton a)
Reverses the language of the given (non-singleton) automaton while returning
the set of new initial states.
|
public static boolean isFinite(Automaton a)
public static String getCommonPrefix(Automaton a)
public static String getCommonSuffix(Automaton a)
public static Set<State> reverse(Automaton a)
public static Set<IntsRef> getFiniteStrings(Automaton a, int limit)
limit
strings. If more than limit
strings are accepted, the first limit strings found are returned. If limit
== -1, then
the limit is infinite. If the Automaton
has
cycles then this method might throw IllegalArgumentException
but that is not guaranteed
when the limit is set.Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.