C# Класс Lucene.Net.Util.Automaton.Automaton

Finite-state automaton with regular expression operations.

Class invariants:

  • An automaton is either represented explicitly (with State and Transition objects) or with a singleton string (see #getSingleton() and #expandSingleton()) in case the automaton is known to accept exactly one string. (Implicitly, all states and transitions of an automaton are reachable from its initial state.)
  • Automata are always reduced (see #reduce()) and have no transitions to dead states (see #removeDeadTransitions()).
  • If an automaton is nondeterministic, then #isDeterministic() returns false (but the converse is not required).
  • Automata provided as input to operations are generally assumed to be disjoint.

If the states or transitions are manipulated manually, the #restoreInvariant() and #setDeterministic(boolean) methods should be used afterwards to restore representation invariants that are assumed by the built-in automata operations.

Note: this class has internal mutable state and is not thread safe. It is the caller's responsibility to ensure any necessary synchronization if you wish to use the same Automaton from multiple threads. In general it is instead recommended to use a RunAutomaton for multithreaded matching: it is immutable, thread safe, and much faster.

@lucene.experimental
Наследование: ICloneable
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
CheckMinimizeAlways void
CloneExpandedIfRequired Automaton
CloneIfRequired Automaton
Totalize void

Открытые методы

Метод Описание
Automaton ( ) : Lucene.Net.Support
Automaton ( State initial ) : Lucene.Net.Support

Constructs a new automaton that accepts the empty language. Using this constructor, automata can be constructed manually from State and Transition objects.

ClearNumberedStates ( ) : void
Clone ( ) : object

Returns a clone of this automaton.

CloneExpanded ( ) : Automaton

Returns a clone of this automaton, expands if singleton.

Complement ( ) : Automaton

See BasicOperations#complement(Automaton).

Concatenate ( Automaton a ) : Automaton

See BasicOperations#concatenate(Automaton, Automaton).

Concatenate ( IList l ) : Automaton

See BasicOperations#concatenate(List).

Determinize ( ) : void

See BasicOperations#determinize(Automaton).

Equals ( object obj ) : bool
ExpandSingleton ( ) : void

Expands singleton representation to normal representation. Does nothing if not in singleton representation.

Intersection ( Automaton a ) : Automaton

See BasicOperations#intersection(Automaton, Automaton).

Minimize ( Automaton a ) : Automaton

See MinimizationOperations#minimize(Automaton). Returns the automaton being given as argument.

Minus ( Automaton a ) : Automaton

See BasicOperations#minus(Automaton, Automaton).

Optional ( ) : Automaton

See BasicOperations#optional(Automaton).

Reduce ( ) : void

Reduces this automaton. An automaton is "reduced" by combining overlapping and adjacent edge intervals with same destination.

RemoveDeadTransitions ( ) : void

Removes transitions to dead states and calls #reduce(). (A state is "dead" if no accept state is reachable from it.)

Repeat ( ) : Automaton

See BasicOperations#repeat(Automaton).

Repeat ( int min ) : Automaton

See BasicOperations#repeat(Automaton, int).

Repeat ( int min, int max ) : Automaton

See BasicOperations#repeat(Automaton, int, int).

RestoreInvariant ( ) : void

Restores representation invariant. this method must be invoked before any built-in automata operation is performed if automaton states or transitions are manipulated manually.

SetAllowMutate ( bool flag ) : bool

Sets or resets allow mutate flag. If this flag is set, then all automata operations may modify automata given as input; otherwise, operations will always leave input automata languages unmodified. By default, the flag is not set.

SetNumberedStates ( State states, int count ) : void
SubsetOf ( Automaton a ) : bool

See BasicOperations#subsetOf(Automaton, Automaton).

ToDot ( ) : string

Returns Graphviz Dot representation of this automaton.

ToString ( ) : string

Returns a string representation of this automaton.

Union ( Automaton a ) : Automaton

See BasicOperations#union(Automaton, Automaton).

Union ( ICollection l ) : Automaton

See BasicOperations#union(Collection).

Приватные методы

Метод Описание
CheckMinimizeAlways ( ) : void
CloneExpandedIfRequired ( ) : Automaton

Returns a clone of this automaton unless allow_mutation is set, expands if singleton.

CloneIfRequired ( ) : Automaton

Returns a clone of this automaton, or this automaton itself if allow_mutation flag is set.

Totalize ( ) : void

Adds transitions to explicit crash state to ensure that transition function is total.

Описание методов

Automaton() публичный Метод

public Automaton ( ) : Lucene.Net.Support
Результат Lucene.Net.Support

Automaton() публичный Метод

Constructs a new automaton that accepts the empty language. Using this constructor, automata can be constructed manually from State and Transition objects.
public Automaton ( State initial ) : Lucene.Net.Support
initial State
Результат Lucene.Net.Support

ClearNumberedStates() публичный Метод

public ClearNumberedStates ( ) : void
Результат void

Clone() публичный Метод

Returns a clone of this automaton.
public Clone ( ) : object
Результат object

CloneExpanded() публичный Метод

Returns a clone of this automaton, expands if singleton.
public CloneExpanded ( ) : Automaton
Результат Automaton

Complement() публичный Метод

See BasicOperations#complement(Automaton).
public Complement ( ) : Automaton
Результат Automaton

Concatenate() публичный Метод

See BasicOperations#concatenate(Automaton, Automaton).
public Concatenate ( Automaton a ) : Automaton
a Automaton
Результат Automaton

Concatenate() публичный статический Метод

See BasicOperations#concatenate(List).
public static Concatenate ( IList l ) : Automaton
l IList
Результат Automaton

Determinize() публичный Метод

See BasicOperations#determinize(Automaton).
public Determinize ( ) : void
Результат void

Equals() публичный Метод

public Equals ( object obj ) : bool
obj object
Результат bool

ExpandSingleton() публичный Метод

Expands singleton representation to normal representation. Does nothing if not in singleton representation.
public ExpandSingleton ( ) : void
Результат void

Intersection() публичный Метод

See BasicOperations#intersection(Automaton, Automaton).
public Intersection ( Automaton a ) : Automaton
a Automaton
Результат Automaton

Minimize() публичный статический Метод

See MinimizationOperations#minimize(Automaton). Returns the automaton being given as argument.
public static Minimize ( Automaton a ) : Automaton
a Automaton
Результат Automaton

Minus() публичный Метод

See BasicOperations#minus(Automaton, Automaton).
public Minus ( Automaton a ) : Automaton
a Automaton
Результат Automaton

Optional() публичный Метод

See BasicOperations#optional(Automaton).
public Optional ( ) : Automaton
Результат Automaton

Reduce() публичный Метод

Reduces this automaton. An automaton is "reduced" by combining overlapping and adjacent edge intervals with same destination.
public Reduce ( ) : void
Результат void

RemoveDeadTransitions() публичный Метод

Removes transitions to dead states and calls #reduce(). (A state is "dead" if no accept state is reachable from it.)
public RemoveDeadTransitions ( ) : void
Результат void

Repeat() публичный Метод

See BasicOperations#repeat(Automaton).
public Repeat ( ) : Automaton
Результат Automaton

Repeat() публичный Метод

See BasicOperations#repeat(Automaton, int).
public Repeat ( int min ) : Automaton
min int
Результат Automaton

Repeat() публичный Метод

See BasicOperations#repeat(Automaton, int, int).
public Repeat ( int min, int max ) : Automaton
min int
max int
Результат Automaton

RestoreInvariant() публичный Метод

Restores representation invariant. this method must be invoked before any built-in automata operation is performed if automaton states or transitions are manipulated manually.
public RestoreInvariant ( ) : void
Результат void

SetAllowMutate() публичный статический Метод

Sets or resets allow mutate flag. If this flag is set, then all automata operations may modify automata given as input; otherwise, operations will always leave input automata languages unmodified. By default, the flag is not set.
public static SetAllowMutate ( bool flag ) : bool
flag bool if true, the flag is set
Результат bool

SetNumberedStates() публичный Метод

public SetNumberedStates ( State states, int count ) : void
states State
count int
Результат void

SubsetOf() публичный Метод

See BasicOperations#subsetOf(Automaton, Automaton).
public SubsetOf ( Automaton a ) : bool
a Automaton
Результат bool

ToDot() публичный Метод

Returns Graphviz Dot representation of this automaton.
public ToDot ( ) : string
Результат string

ToString() публичный Метод

Returns a string representation of this automaton.
public ToString ( ) : string
Результат string

Union() публичный Метод

See BasicOperations#union(Automaton, Automaton).
public Union ( Automaton a ) : Automaton
a Automaton
Результат Automaton

Union() публичный статический Метод

See BasicOperations#union(Collection).
public static Union ( ICollection l ) : Automaton
l ICollection
Результат Automaton