Package fsa_recognizer :: Module class_det_fsa_recognize :: Class det_fsa_recognizer
[hide private]
[frames] | no frames]

Class det_fsa_recognizer

source code

class_fsa_recognize.fsa_recognizer --+
                                     |
                                    det_fsa_recognizer

Class for deterministic fsa recognizers.

Every recognizer must be given an fsa upon creation:

>>> det_fsa_recognizer(fsa1)
Instance Methods [hide private]
 
__init__(self, fsa_inst, trace=False) source code
Boolean
recognize(self, string)
Initialize state to the initial state of the FSA.
source code

Inherited from class_fsa_recognize.fsa_recognizer: __repr__, non_final_state_message, not_in_alphabet_message, state_not_defined_for_message, trace

Method Details [hide private]

__init__(self, fsa_inst, trace=False)
(Constructor)

source code 
Parameters:
  • fsa - The fsa to be used for recognizing
  • trace - If True, gives verbose output on recognizing
Overrides: class_fsa_recognize.fsa_recognizer.__init__
(inherited documentation)

recognize(self, string)

source code 

Initialize state to the initial state of the FSA. Iterate through string updating the value of state where possible, and returning False if unable to reach the end of string with state set to a final state.

Parameters:
  • string - the string to be recognized.
Returns: Boolean
Overrides: class_fsa_recognize.fsa_recognizer.recognize