Abstract Class Zend_Search_Lucene_FSM

Description

Abstract Finite State Machine

Take a look on Wikipedia state machine description: http://en.wikipedia.org/wiki/Finite_state_machine

Any type of Transducers (Moore machine or Mealy machine) also may be implemented by using this abstract FSM. process() methods invokes a specified actions which may construct FSM output. Actions may be also used to signal, that we have reached Accept State

  • copyright: Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  • abstract:
  • license: New BSD License

Located in /Search/Lucene/FSM.php (line 39)


	
			
Direct descendents
Method Summary
 Zend_Search_Lucene_FSM __construct ([array $states = array()], [array $inputAphabet = array()], [array $rules = array()])
 void addEntryAction (integer|string $state, Zend_Search_Lucene_FSMAction $action)
 void addExitAction (integer|string $state, Zend_Search_Lucene_FSMAction $action)
 void addInputAction (integer|string $state,  $inputSymbol, Zend_Search_Lucene_FSMAction $action, integer|string $input)
 void addInputSymbol (integer|string $inputSymbol)
 void addInputSymbols (array $inputAphabet)
 void addRule (integer|string $sourceState, integer|string $input, integer|string $targetState, [Zend_Search_Lucene_FSMAction|null $inputAction = null])
 void addRules (array $rules)
 void addState (integer|string $state)
 void addStates (array $states)
 void addTransitionAction (integer|string $sourceState, integer|string $targetState, Zend_Search_Lucene_FSMAction $action)
 integer|string getState ()
 void process (mixed $input)
 void reset ()
 void setState (integer|string $state)
Methods
Constructor __construct (line 137)

Finite State machine constructor

$states is an array of integers or strings with a list of possible machine states constructor treats fist list element as a sturt state (assignes it to $_current state). It may be reassigned by setState() call. States list may be empty and can be extended later by addState() or addStates() calls.

$inputAphabet is the same as $states, but represents input alphabet it also may be extended later by addInputSymbols() or addInputSymbol() calls.

$rules parameter describes FSM transitions and has a structure: array( array(sourseState, input, targetState[, inputAction]), array(sourseState, input, targetState[, inputAction]), array(sourseState, input, targetState[, inputAction]), ... ) Rules also can be added later by addRules() and addRule() calls.

FSM actions are very flexible and may be defined by addEntryAction(), addExitAction(), addInputAction() and addTransitionAction() calls.

  • access: public
Zend_Search_Lucene_FSM __construct ([array $states = array()], [array $inputAphabet = array()], [array $rules = array()])
  • array $states
  • array $inputAphabet
  • array $rules

Redefined in descendants as:
addEntryAction (line 288)

Add state entry action.

Several entry actions are allowed. Action execution order is defined by addEntryAction() calls

  • access: public
void addEntryAction (integer|string $state, Zend_Search_Lucene_FSMAction $action)
addExitAction (line 310)

Add state exit action.

Several exit actions are allowed. Action execution order is defined by addEntryAction() calls

  • access: public
void addExitAction (integer|string $state, Zend_Search_Lucene_FSMAction $action)
addInputAction (line 333)

Add input action (defined by {state, input} pair).

Several input actions are allowed. Action execution order is defined by addInputAction() calls

  • access: public
void addInputAction (integer|string $state,  $inputSymbol, Zend_Search_Lucene_FSMAction $action, integer|string $input)
addInputSymbol (line 214)

Add symbol to the input alphabet

  • access: public
void addInputSymbol (integer|string $inputSymbol)
  • integer|string $inputSymbol
addInputSymbols (line 202)

Add symbols to the input alphabet

  • access: public
void addInputSymbols (array $inputAphabet)
  • array $inputAphabet
addRule (line 248)

Add symbol to the input alphabet

  • throws: Zend_Search_Exception
  • access: public
void addRule (integer|string $sourceState, integer|string $input, integer|string $targetState, [Zend_Search_Lucene_FSMAction|null $inputAction = null])
addRules (line 232)

Add transition rules

array structure: array( array(sourseState, input, targetState[, inputAction]), array(sourseState, input, targetState[, inputAction]), array(sourseState, input, targetState[, inputAction]), ... )

  • access: public
void addRules (array $rules)
  • array $rules
addState (line 161)

Add state to the state machine

  • access: public
void addState (integer|string $state)
  • integer|string $state
addStates (line 149)

Add states to the state machine

  • access: public
void addStates (array $states)
  • array $states
addTransitionAction (line 363)

Add transition action (defined by {state, input} pair).

Several transition actions are allowed. Action execution order is defined by addTransitionAction() calls

  • access: public
void addTransitionAction (integer|string $sourceState, integer|string $targetState, Zend_Search_Lucene_FSMAction $action)
getState (line 192)

Get FSM state.

  • access: public
integer|string getState ()
process (line 391)

Process an input

  • throws: Zend_Search_Exception
  • access: public
void process (mixed $input)
  • mixed $input
reset (line 433)
  • access: public
void reset ()
setState (line 177)

Set FSM state.

No any action is invoked

  • throws: Zend_Search_Exception
  • access: public
void setState (integer|string $state)
  • integer|string $state

Documentation generated on Mon, 21 Jun 2010 15:25:01 -0400 by phpDocumentor 1.4.3