|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.lucene.util.automaton.AutomatonTestUtil
public class AutomatonTestUtil
Utilities for testing automata.
Capable of generating random regular expressions, and automata, and also provides a number of very basic unoptimized implementations (*slow) for testing.
| Nested Class Summary | |
|---|---|
static class |
AutomatonTestUtil.RandomAcceptedStrings
Lets you retrieve random strings accepted by an Automaton. |
| Constructor Summary | |
|---|---|
AutomatonTestUtil()
|
|
| Method Summary | |
|---|---|
static void |
assertNoDetachedStates(Automaton a)
Checks that an automaton has no detached states that are unreachable from the initial state. |
static void |
determinizeSimple(Automaton a)
Simple, original brics implementation of determinize() |
static void |
determinizeSimple(Automaton a,
Set<State> initialset)
Simple, original brics implementation of determinize() Determinizes the given automaton using the given set of initial states. |
static boolean |
isFiniteSlow(Automaton a)
Returns true if the language of this automaton is finite. |
static void |
minimizeSimple(Automaton a)
Simple, original brics implementation of Brzozowski minimize() |
static Automaton |
randomAutomaton(Random random)
return a random NFA/DFA for testing |
static String |
randomRegexp(Random r)
Returns random string, including full unicode range. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AutomatonTestUtil()
| Method Detail |
|---|
public static String randomRegexp(Random r)
public static Automaton randomAutomaton(Random random)
public static void minimizeSimple(Automaton a)
public static void determinizeSimple(Automaton a)
public static void determinizeSimple(Automaton a,
Set<State> initialset)
public static boolean isFiniteSlow(Automaton a)
WARNING: this method is slow, it will blow up if the automaton is large. this is only used to test the correctness of our faster implementation.
public static void assertNoDetachedStates(Automaton a)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||