Sequence Recognition using fsm in python
<p>What is the best way to detect a sequence of characters in python?</p>

<p>I'm trying to use transitions package by Tal yarkoni for creating fsm's based on input sequences. Then i want to use the created fsms for new sequence recognition. 
I'm storing the created fsm in a dict with sequence number as key. </p>

<p>All the fsms from the dictionary should make transition as per input chars. The one which reaches end state is the required sequence and the function should return the key. </p>

<p>Problem is that there is no concept of end state in the transitions fsm model. 
Is it possible to do this using transitions package?</p>

<p>There is no concept of end state, but you can define a state 'end' on each fsm and check for it (see 'checking state' in the git readme), or you could add a 'on enter' reference on the 'end' state and that function will be called when the 'end' state is entered.</p>

<p>Haven't seen transitions before, looks very nice, I like being able to produce the diagrams.</p>

python transitions