command text parsing and hints displaying on user input.

A

Andy

Hi guys,

I'm writing a program with a feature of accepting user input as command
text and parsing it to correct function calls...example:

"5 minutes later"/"5 min later"/"5 minute later"/"after 5 minutes"...
are being parsed as the same rule so the system will call a later
function with minutes=5 as parameter.

Of course there are many other possiblilities, "seconds"/"days", and
even "every(each) hour"/"every Monday"/"every two days"...so on...

The datetime computation can be done with the wonderful "dateutil"
package, but I'm not sure with the command text parsing part. I could
do a lot of regular expression, but it'll be great if there is already
something similar available...or even a hint that can make it easier
than hand-writing a lot of regular expression code...

Another requirment is to display useful hints when user input the
command text. Example:

user input:"5" -> hints: "5 minutes later/5 hours later/5 days
later/every 5 minutes"
user input:"fi" -> hints: "next Friday"/"first thing tommorrow"
user input:"ne" -> hints: "next day"/"next hour"/"next week"/"next
month"

Sounds too intelligent to do? Any advices on this?

Thanks guys.

Andy
 
K

Kent Johnson

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,534
Members
45,007
Latest member
obedient dusk

Latest Threads

Top