C# Class 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
Inheritance: ICloneable
Afficher le fichier Open project: paulirwin/lucene.net Class Usage Examples

Private Properties

Свойство Type Description
CheckMinimizeAlways void
CloneExpandedIfRequired Automaton
CloneIfRequired Automaton
Totalize void

Méthodes publiques

Méthode Description
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).

Private Methods

Méthode Description
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.

Method Details

Automaton() public méthode

public Automaton ( ) : Lucene.Net.Support
Résultat Lucene.Net.Support

Automaton() public méthode

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
Résultat Lucene.Net.Support

ClearNumberedStates() public méthode

public ClearNumberedStates ( ) : void
Résultat void

Clone() public méthode

Returns a clone of this automaton.
public Clone ( ) : object
Résultat object

CloneExpanded() public méthode

Returns a clone of this automaton, expands if singleton.
public CloneExpanded ( ) : Automaton
Résultat Automaton

Complement() public méthode

See BasicOperations#complement(Automaton).
public Complement ( ) : Automaton
Résultat Automaton

Concatenate() public méthode

See BasicOperations#concatenate(Automaton, Automaton).
public Concatenate ( Automaton a ) : Automaton
a Automaton
Résultat Automaton

Concatenate() public static méthode

See BasicOperations#concatenate(List).
public static Concatenate ( IList l ) : Automaton
l IList
Résultat Automaton

Determinize() public méthode

See BasicOperations#determinize(Automaton).
public Determinize ( ) : void
Résultat void

Equals() public méthode

public Equals ( object obj ) : bool
obj object
Résultat bool

ExpandSingleton() public méthode

Expands singleton representation to normal representation. Does nothing if not in singleton representation.
public ExpandSingleton ( ) : void
Résultat void

Intersection() public méthode

See BasicOperations#intersection(Automaton, Automaton).
public Intersection ( Automaton a ) : Automaton
a Automaton
Résultat Automaton

Minimize() public static méthode

See MinimizationOperations#minimize(Automaton). Returns the automaton being given as argument.
public static Minimize ( Automaton a ) : Automaton
a Automaton
Résultat Automaton

Minus() public méthode

See BasicOperations#minus(Automaton, Automaton).
public Minus ( Automaton a ) : Automaton
a Automaton
Résultat Automaton

Optional() public méthode

See BasicOperations#optional(Automaton).
public Optional ( ) : Automaton
Résultat Automaton

Reduce() public méthode

Reduces this automaton. An automaton is "reduced" by combining overlapping and adjacent edge intervals with same destination.
public Reduce ( ) : void
Résultat void

RemoveDeadTransitions() public méthode

Removes transitions to dead states and calls #reduce(). (A state is "dead" if no accept state is reachable from it.)
public RemoveDeadTransitions ( ) : void
Résultat void

Repeat() public méthode

See BasicOperations#repeat(Automaton).
public Repeat ( ) : Automaton
Résultat Automaton

Repeat() public méthode

See BasicOperations#repeat(Automaton, int).
public Repeat ( int min ) : Automaton
min int
Résultat Automaton

Repeat() public méthode

See BasicOperations#repeat(Automaton, int, int).
public Repeat ( int min, int max ) : Automaton
min int
max int
Résultat Automaton

RestoreInvariant() public méthode

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
Résultat void

SetAllowMutate() public static méthode

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
Résultat bool

SetNumberedStates() public méthode

public SetNumberedStates ( State states, int count ) : void
states State
count int
Résultat void

SubsetOf() public méthode

See BasicOperations#subsetOf(Automaton, Automaton).
public SubsetOf ( Automaton a ) : bool
a Automaton
Résultat bool

ToDot() public méthode

Returns Graphviz Dot representation of this automaton.
public ToDot ( ) : string
Résultat string

ToString() public méthode

Returns a string representation of this automaton.
public ToString ( ) : string
Résultat string

Union() public méthode

See BasicOperations#union(Automaton, Automaton).
public Union ( Automaton a ) : Automaton
a Automaton
Résultat Automaton

Union() public static méthode

See BasicOperations#union(Collection).
public static Union ( ICollection l ) : Automaton
l ICollection
Résultat Automaton