felciano
unread,Jul 20, 2008, 11:19:53 PM7/20/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message as abuse
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to parsedatetime-dev
Hi --
I'm loving parsedatetime -- it is a great module! Is it possible to
use the parser to grab dates out of the middle of strings? I would
like to grab dates from task description sentences like this:
- Finish the Report #next friday @home
- #next friday finish the report
- Email George about tennis #jan 5 08
- Get a loan #tomorrow (2 hours)
I'm trying to keep the syntax minimal, but I can reasonably rely on
using a simple delimiter like # to indicate where a date string
starts. However, there may be other text following the date, like a
category tag (@home), duration (2 hours), etc. So what I'd like is to
be able to pass in "#next friday finish the report" into parse and
have it return a (datetuple, restofstring) tuple, where restofstring
would be " finish the report".
Is there a straightforward way to do this with parsedatetime today?
Thanks!
Ramon