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.
Inheritance
AutomatonTestUtil
Assembly: Lucene.Net.TestFramework.dll
Syntax
public static class AutomatonTestUtil
Methods
AssertNoDetachedStates(Automaton)
Checks that an automaton has no detached states that are unreachable
from the initial state.
Declaration
public static void AssertNoDetachedStates(Automaton a)
Parameters
Type |
Name |
Description |
Automaton |
a |
|
DeterminizeSimple(Automaton)
Simple, original brics implementation of Determinize()
Declaration
public static void DeterminizeSimple(Automaton a)
Parameters
Type |
Name |
Description |
Automaton |
a |
|
DeterminizeSimple(Automaton, ISet<State>)
Simple, original brics implementation of Determinize()
Determinizes the given automaton using the given set of initial states.
Declaration
public static void DeterminizeSimple(Automaton a, ISet<State> initialset)
Parameters
Type |
Name |
Description |
Automaton |
a |
|
ISet<State> |
initialset |
|
IsFiniteSlow(Automaton)
Returns true if the language of this automaton is finite.
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.
Declaration
public static bool IsFiniteSlow(Automaton a)
Parameters
Type |
Name |
Description |
Automaton |
a |
|
Returns
MinimizeSimple(Automaton)
Simple, original brics implementation of Brzozowski Minimize()
Declaration
public static void MinimizeSimple(Automaton a)
Parameters
Type |
Name |
Description |
Automaton |
a |
|
RandomAutomaton(Random)
Return a random NFA/DFA for testing.
Declaration
public static Automaton RandomAutomaton(Random random)
Parameters
Type |
Name |
Description |
Random |
random |
|
Returns
Type |
Description |
Automaton |
|
RandomRegexp(Random)
Returns random string, including full unicode range.
Declaration
public static string RandomRegexp(Random r)
Parameters
Type |
Name |
Description |
Random |
r |
|
Returns