how to build simple FSM using generators ?

J

Joh

hello,

i've readed "Charming Python: Generator-based state machines"
www-106.ibm.com/developerworks/ linux/library/l-pygen.html , but i
still can not get the point on how using generator for FSM

i'm interested in a very simple FSM which would be able to recognize
consecutive sequence of texts, please can someone give me a hint on
how to do this using yield ?

by now, my fsm is something like, having a "previous state", iterating
in a while 1 loop, advancing "previous state" to recognized word and
if len(recognized all words) is matched then a sequence had been
recognized, whatever else re-init FSM ;
but can not understand how could yield help me...

thx.
 
A

Alan Kennedy

[Joh]
i've readed "Charming Python: Generator-based state machines"
www-106.ibm.com/developerworks/ linux/library/l-pygen.html , but i
still can not get the point on how using generator for FSM

i'm interested in a very simple FSM which would be able to recognize
consecutive sequence of texts, please can someone give me a hint on
how to do this using yield ?

Have you seen this old post of mine, which looks like it might be
relevant to you.

http://groups.google.com/[email protected]

regards,
 
J

Joh

Alan Kennedy said:
[Joh]

Have you seen this old post of mine, which looks like it might be
relevant to you.

http://groups.google.com/[email protected]

yes, just few days after this post, BTW it is a difficult thread to
follow, i've readed it 3 times and think i must still re-read to get
everything of it... but even i feel it helps me more than
developerworks one.

will you one day write the article / summary you were talking about ?

best,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top