[Tutor] parsing x is y statements from stdin
Danny Yoo
dyoo@hkn.eecs.berkeley.edu
Thu Jul 17 23:43:02 2003
On Thu, 17 Jul 2003, Scott Fallin wrote:
> I'm trying to figure out how best to parse a string such as "It is hot
> today". I want to check for the existance of a predefined verb that
> will always be located in the middle of the sentence, and if the verb
> test passes, I want to chop the sentence up in to variables, var1 =
> 'It', var2 = 'is', and var3 = "hot today".
>
> I can do it in Perl but for some reason it is elluding me in Python.
Hi Scott,
Can you show us how you're doing it in Perl? We'll be happy to help you
apply your knowledge of Perl to better understand how to do it in Python.
By the way, you may be interested in a module called 'Monty Tagger':
http://web.media.mit.edu/~hugo/research/montytagger.html
You may not even need to write much code. *grin*
Good luck to you!