How do I find possible matches using regular expression?

Andy icetortoise at
Thu Nov 23 13:53:08 CET 2006

OK, here's what I want...

I'm doing a auto-tasking tool in which user can specify the execution
rule by inputting English instead of a complex GUI interface(Normally a
combination of many controls). This way is way better user interaction.

So the problem comes down to "understanding" user input and
"suggesting" possible inputs when user is writing a rule.

Rules will be like "30 minutes later", "Next Monday", "Every 3 hours",
"3pm"...Sure this is an infinite collection, but it doesn't have to be
perfect , it might make mistakes given inputs like "10 minutes after
Every Monday noon".

The "suggesting" feature is even harder, I'm still investigating

Tried NLTK_Lite, I'm sure it can understands well a good user input,
but it is not doing good with some bad inputs("2 hours later here"),
bad inputs makes the toolkit fails to parse it. And NLTK also does not
help on the suggesting part.

Now I'm thinking manipulating regular expressions. I think it's
possible to come up with a collection of REs to understand basic
execution rules. And the question is again how to do suggestions with
the RE collection.

Any thoughts on this subject?

I'm not a native English speaker so...please, be mistake tolerant with
my post here:-)

"Fredrik Lundh 写道:
> Andy wrote:
> > The problem is the input will be much more complex than the example, it
> > could be something like "30 minutes later" where any string starting
> > with a number is a possible match.
> so if I type "1", are you going to suggest all possible numbers
> that start with that digit?  doesn't strike me as very practical.
> maybe you could post a more detailed example, where you clearly
> explain what a pattern is and how it is defined, what prediction
> means, and what you want to happen as new input arrives, so we
> don't have to guess?
> </F>

More information about the Python-list mailing list