public function addRule($sourceState, $input, $targetState, $inputAction = null)
    {
        if (!isset($this->_states[$sourceState])) {
            include_once 'Zend/Search/Exception.php';
            throw new Zend_Search_Exception('Undefined source state (' . $sourceState . ').');
        }
        if (!isset($this->_states[$targetState])) {
            include_once 'Zend/Search/Exception.php';
            throw new Zend_Search_Exception('Undefined target state (' . $targetState . ').');
        }
        if (!isset($this->_inputAphabet[$input])) {
            include_once 'Zend/Search/Exception.php';
            throw new Zend_Search_Exception('Undefined input symbol (' . $input . ').');
        }

        if (!isset($this->_rules[$sourceState])) {
            $this->_rules[$sourceState] = array();
        }
        if (isset($this->_rules[$sourceState][$input])) {
            include_once 'Zend/Search/Exception.php';
            throw new Zend_Search_Exception('Rule for {state,input} pair (' . $sourceState . ', '. $input . ') is already defined.');
        }

        $this->_rules[$sourceState][$input] = $targetState;


        if ($inputAction !== null) {
            $this->addInputAction($sourceState, $input, $inputAction);
        }
    }
public function addRule($sourceState, $input, $targetState, $inputAction = null)
    {
        if (!isset($this->_states[$sourceState])) {
            include_once 'Zend/Search/Exception.php';
            throw new Zend_Search_Exception('Undefined source state (' . $sourceState . ').');
        }
        if (!isset($this->_states[$targetState])) {
            include_once 'Zend/Search/Exception.php';
            throw new Zend_Search_Exception('Undefined target state (' . $targetState . ').');
        }
        if (!isset($this->_inputAphabet[$input])) {
            include_once 'Zend/Search/Exception.php';
            throw new Zend_Search_Exception('Undefined input symbol (' . $input . ').');
        }

        if (!isset($this->_rules[$sourceState])) {
            $this->_rules[$sourceState] = array();
        }
        if (isset($this->_rules[$sourceState][$input])) {
            include_once 'Zend/Search/Exception.php';
            throw new Zend_Search_Exception('Rule for {state,input} pair (' . $sourceState . ', '. $input . ') is already defined.');
        }

        $this->_rules[$sourceState][$input] = $targetState;


        if ($inputAction !== null) {
            $this->addInputAction($sourceState, $input, $inputAction);
        }
    }
public function addRule ( $ sourceState , $ input , $ targetState , $ inputAction = null ) { if ( ! isset ( $ this -> _states [ $ sourceState ] ) ) { include_once 'Zend/Search/Exception.php' ; throw new Zend_Search_Exception ( 'Undefined source state (' . $ sourceState . ').' ) ; } if ( ! isset ( $ this -> _states [ $ targetState ] ) ) { include_once 'Zend/Search/Exception.php' ; throw new Zend_Search_Exception ( 'Undefined target state (' . $ targetState . ').' ) ; } if ( ! isset ( $ this -> _inputAphabet [ $ input ] ) ) { include_once 'Zend/Search/Exception.php' ; throw new Zend_Search_Exception ( 'Undefined input symbol (' . $ input . ').' ) ; } if ( ! isset ( $ this -> _rules [ $ sourceState ] ) ) { $ this -> _rules [ $ sourceState ] = array ( ) ; } if ( isset ( $ this -> _rules [ $ sourceState ] [ $ input ] ) ) { include_once 'Zend/Search/Exception.php' ; throw new Zend_Search_Exception ( 'Rule for {state,input} pair (' . $ sourceState . ', ' . $ input . ') is already defined.' ) ; } $ this -> _rules [ $ sourceState ] [ $ input ] = $ targetState ; if ( $ inputAction !== null ) { $ this -> addInputAction ( $ sourceState , $ input , $ inputAction ) ; } }
Add symbol to the input alphabet

@param  integer|string                    $sourceState
@param  integer|string                    $input
@param  integer|string                    $targetState
@param  Zend_Search_Lucene_FSMAction|null $inputAction
@throws Zend_Search_Exception
Add symbol to the input alphabet