472,331 Members | 1,488 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,331 software developers and data experts.

command text parsing and hints displaying on user input.

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

Oct 16 '06 #1
2 1762
Anybody have an idea on this??
Does Natural Language Processing help in this case?

Oct 17 '06 #2
Andy wrote:
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.
Maybe one of these will help:
http://cheeseshop.python.org/pypi/parsedatetime/0.7.4
http://cheeseshop.python.org/pypi/when/1

Kent
Oct 17 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Paul M | last post by:
Hi there, i hope someone can help me out here.. I have a input screen where i want the user to enter text in 2 different languages, english and...
8
by: BiNZGi | last post by:
Hi I have reduced the problem to this code: <form> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td><input...
3
by: James D. Marshall | last post by:
Please point me to some articles that explain how to execute a dos type command and retrieve its output for processing. Thanks.
5
by: Gene | last post by:
What can I do if I want to get the result using the sql command? for example, the select command is "select Name from Employee where StaffID=10"...
6
by: portCo | last post by:
Hello there, I am creating a vb application which is some like like a questionare. Application read a text file which contains many questions...
13
by: Chris Carlen | last post by:
Hi: Having completed enough serial driver code for a TMS320F2812 microcontroller to talk to a terminal, I am now trying different approaches to...
1
by: littlealex | last post by:
IE6 not displaying text correctly - IE 7 & Firefox 3 are fine! Need some help with this as fairly new to CSS! In IE6 the text for the following...
1
by: angelicdevil | last post by:
i have listbox 1 which displays status , based on selection of status listbox 2 displays usernames. and based on username selected the textbox...
0
by: JosAH | last post by:
A Simple Text-Based Menu System Read this this post; there are numerous posts like that: a newbie struggling with some sort of menu...
0
by: tammygombez | last post by:
Hey everyone! I've been researching gaming laptops lately, and I must say, they can get pretty expensive. However, I've come across some great...
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: CD Tom | last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.