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
파일 보기 프로젝트 열기: paulirwin/lucene.net 1 사용 예제들

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