Class BasicOperations
Basic automata operations.
Note
This API is experimental and might change in incompatible ways in the next release.
Inheritance
BasicOperations
Assembly: Lucene.Net.dll
Syntax
public static class BasicOperations
Methods
AddEpsilons(Automaton, ICollection<StatePair>)
Adds epsilon transitions to the given automaton. This method adds extra
character interval transitions that are equivalent to the given set of
epsilon transitions.
Declaration
public static void AddEpsilons(Automaton a, ICollection<StatePair> pairs)
Parameters
Type |
Name |
Description |
Automaton |
a |
Automaton.
|
ICollection<StatePair> |
pairs |
Collection of StatePair objects representing pairs of
source/destination states where epsilon transitions should be
added.
|
Complement(Automaton)
Returns a (deterministic) automaton that accepts the complement of the
language of the given automaton.
Complexity: linear in number of states (if already deterministic).
Declaration
public static Automaton Complement(Automaton a)
Parameters
Returns
Concatenate(Automaton, Automaton)
Returns an automaton that accepts the concatenation of the languages of the
given automata.
Complexity: linear in number of states.
Declaration
public static Automaton Concatenate(Automaton a1, Automaton a2)
Parameters
Returns
Concatenate(IList<Automaton>)
Returns an automaton that accepts the concatenation of the languages of the
given automata.
Complexity: linear in total number of states.
Declaration
public static Automaton Concatenate(IList<Automaton> l)
Parameters
Returns
Determinize(Automaton)
Determinizes the given automaton.
Worst case complexity: exponential in number of states.
Declaration
public static void Determinize(Automaton a)
Parameters
Intersection(Automaton, Automaton)
Returns an automaton that accepts the intersection of the languages of the
given automata. Never modifies the input automata languages.
Complexity: quadratic in number of states.
Declaration
public static Automaton Intersection(Automaton a1, Automaton a2)
Parameters
Returns
IsEmpty(Automaton)
Returns true
if the given automaton accepts no strings.
Declaration
public static bool IsEmpty(Automaton a)
Parameters
Returns
IsEmptyString(Automaton)
Returns true
if the given automaton accepts the empty string and nothing
else.
Declaration
public static bool IsEmptyString(Automaton a)
Parameters
Returns
IsTotal(Automaton)
Returns true
if the given automaton accepts all strings.
Declaration
public static bool IsTotal(Automaton a)
Parameters
Returns
Minus(Automaton, Automaton)
Returns a (deterministic) automaton that accepts the intersection of the
language of a1
and the complement of the language of
a2
. As a side-effect, the automata may be determinized, if not
already deterministic.
Complexity: quadratic in number of states (if already deterministic).
Declaration
public static Automaton Minus(Automaton a1, Automaton a2)
Parameters
Returns
Optional(Automaton)
Returns an automaton that accepts the union of the empty string and the
language of the given automaton.
Complexity: linear in number of states.
Declaration
public static Automaton Optional(Automaton a)
Parameters
Returns
Repeat(Automaton)
Returns an automaton that accepts the Kleene star (zero or more
concatenated repetitions) of the language of the given automaton. Never
modifies the input automaton language.
Complexity: linear in number of states.
Declaration
public static Automaton Repeat(Automaton a)
Parameters
Returns
Repeat(Automaton, int)
Returns an automaton that accepts min
or more concatenated
repetitions of the language of the given automaton.
Complexity: linear in number of states and in
min
.
Declaration
public static Automaton Repeat(Automaton a, int min)
Parameters
Returns
Repeat(Automaton, int, int)
Returns an automaton that accepts between min
and
max
(including both) concatenated repetitions of the language
of the given automaton.
Complexity: linear in number of states and in
min
and
max
.
Declaration
public static Automaton Repeat(Automaton a, int min, int max)
Parameters
Returns
Run(Automaton, string)
Returns true
if the given string is accepted by the automaton.
Complexity: linear in the length of the string.
Note: for full performance, use the
RunAutomaton class.
Declaration
public static bool Run(Automaton a, string s)
Parameters
Returns
SameLanguage(Automaton, Automaton)
Returns true
if these two automata accept exactly the
same language. This is a costly computation! Note
also that a1
and a2
will be determinized as a side
effect.
Declaration
public static bool SameLanguage(Automaton a1, Automaton a2)
Parameters
Returns
SubsetOf(Automaton, Automaton)
Returns true if the language of a1
is a subset of the language
of a2
. As a side-effect, a2
is determinized if
not already marked as deterministic.
Complexity: quadratic in number of states.
Declaration
public static bool SubsetOf(Automaton a1, Automaton a2)
Parameters
Returns
Union(Automaton, Automaton)
Returns an automaton that accepts the union of the languages of the given
automata.
Complexity: linear in number of states.
Declaration
public static Automaton Union(Automaton a1, Automaton a2)
Parameters
Returns
Union(ICollection<Automaton>)
Returns an automaton that accepts the union of the languages of the given
automata.
Complexity: linear in number of states.
Declaration
public static Automaton Union(ICollection<Automaton> l)
Parameters
Returns