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
category | Zend |
---|---|
package | Zend_Search_Lucene |
subpackage | Search |
copyright | Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
license | New BSD License |
inherited_from | \Zend_Search_Lucene_FSM |
__construct()
$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.
inherited_from | \Zend_Search_Lucene_FSM::__construct() |
---|
__construct(array $states= array()
, array $inputAphabet= array()
, array $rules= array()
)
$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.
array
array
array
addEntryAction(integer|string $state, \Zend_Search_Lucene_FSMAction $action)
Several entry actions are allowed. Action execution order is defined by addEntryAction() calls
integer
string
\Zend_Search_Lucene_FSMAction
addExitAction(integer|string $state, \Zend_Search_Lucene_FSMAction $action)
Several exit actions are allowed. Action execution order is defined by addEntryAction() calls
integer
string
\Zend_Search_Lucene_FSMAction
addInputAction(integer|string $state, $inputSymbol, \Zend_Search_Lucene_FSMAction $action)
Several input actions are allowed. Action execution order is defined by addInputAction() calls
integer
string
\Zend_Search_Lucene_FSMAction
addInputSymbol(integer|string $inputSymbol)
integer
string
addInputSymbols(array $inputAphabet)
array
addPhraseEntry()
addRule(integer|string $sourceState, integer|string $input, integer|string $targetState, \Zend_Search_Lucene_FSMAction|null $inputAction = null
)
integer
string
integer
string
integer
string
\Zend_Search_Lucene_FSMAction
null
\Zend_Search_Exception |
---|
addRules(array $rules)
array structure: array( array(sourseState, input, targetState[, inputAction]), array(sourseState, input, targetState[, inputAction]), array(sourseState, input, targetState[, inputAction]), ... )
array
addState(integer|string $state)
integer
string
addStates(array $states)
array
addTermEntry()
addTransitionAction(integer|string $sourceState, integer|string $targetState, \Zend_Search_Lucene_FSMAction $action)
Several transition actions are allowed. Action execution order is defined by addTransitionAction() calls
integer
string
integer
string
\Zend_Search_Lucene_FSMAction
closedRQFirstTerm()
closedRQLastTerm()
\Zend_Search_Lucene_Search_QueryParserException |
---|
dontSuppressQueryParsingExceptions()
escape(string $keyword) : string
string
string
getDefaultEncoding() : string
string
getDefaultOperator() : integer
integer
getState() : integer | string
integer
string
$state|nulllogicalOperator()
openedRQFirstTerm()
openedRQLastTerm()
\Zend_Search_Lucene_Search_QueryParserException |
---|
parse(string $strQuery, string $encoding = null
) : \Zend_Search_Lucene_Search_Query
string
string
\Zend_Search_Lucene_Search_QueryParserException |
---|
\Zend_Search_Lucene_Search_Query
process(mixed $input)
mixed
\Zend_Search_Exception |
---|
processFuzzyProximityModifier()
processModifierParameter()
\Zend_Search_Lucene_Exception |
---|
queryParsingExceptionsSuppressed() : boolean
boolean
reset()
setDefaultEncoding(string $encoding)
string
setDefaultOperator(integer $operator)
integer
setField()
setSign()
setState(integer|string $state)
No any action is invoked
integer
string
\Zend_Search_Exception |
---|
subqueryEnd()
subqueryStart()
suppressQueryParsingExceptions()
_getInstance() : \Zend_Search_Lucene_Search_QueryParser
\Zend_Search_Lucene_Search_QueryParser
$_context : \Zend_Search_Lucene_Search_QueryParserContext
$_contextStack : array
$_currentState : integer | string
null
$_currentToken : integer | string
$_defaultEncoding : string
''
$_defaultOperator : integer
self::B_OR
$_encoding : string
$_entryActions : array
array()
[state] => action
$_exitActions : array
array()
[state] => action
$_inputActions : array
array()
[state][input] => action
$_inputAphabet : array
array()
$_instance : \Zend_Search_Lucene_Search_QueryParser
null
$_lastToken : \Zend_Search_Lucene_Search_QueryToken
null
It can be processed within FSM states, but this addirional state simplifies FSM
$_lexer : \Zend_Search_Lucene_Search_QueryLexer
$_rqFirstTerm : string
null
$_rules : array
array()
[sourceState][input] => targetState
$_states : array
array()
$_suppressQueryParsingExceptions : boolean
true
If this option is turned on, then query parser suppress query parser exceptions and constructs multi-term query using all words from a query.
That helps to avoid exceptions caused by queries, which don't conform to query language, but limits possibilities to check, that query entered by user has some inconsistencies.
Default is true.
Use \Zend_Search_Lucene::suppressQueryParsingExceptions(), \Zend_Search_Lucene::dontSuppressQueryParsingExceptions() and \Zend_Search_Lucene::checkQueryParsingExceptionsSuppressMode() to operate with this setting.
$_tokens : array
$_transitionActions : array
array()
[state1][state2] => action
B_AND = 1
B_OR = 0
ST_CLOSEDINT_RQ_END = 5
ST_CLOSEDINT_RQ_FIRST_TERM = 2
ST_CLOSEDINT_RQ_LAST_TERM = 4
ST_CLOSEDINT_RQ_START = 1
ST_CLOSEDINT_RQ_TO_TERM = 3
ST_COMMON_QUERY_ELEMENT = 0
ST_OPENEDINT_RQ_END = 10
ST_OPENEDINT_RQ_FIRST_TERM = 7
ST_OPENEDINT_RQ_LAST_TERM = 9
ST_OPENEDINT_RQ_START = 6
ST_OPENEDINT_RQ_TO_TERM = 8