Parsing of emails for date/time information
Introduction
The goal is to parse emails to check whether there is any date/time information in it which can be useful to stamp that item as an event on the Calendar or to set a Reminder for it.
The
ParseDateTime library will be used for this purpose.
Different Approaches
Following are the various approaches to do this:
1. Automatic approach:
The incoming emails are parsed when they are pulled down from the server. The outgoing mails are parsed as soon as they are sent and moved to the "Out" folder.
Cons: If many emails arrive at the same time, the process might slightly slow down . Also, there might be many messages which the user does not even care about and might just delete simply looking at the subject line. Parsing such emails would be a waste of time.
Solution: Emails should be parsed only when the user selects to read them i.e. when the msg is displayed in the Detail view and the items should be stamped automatically.
Cons: Many new tasks and items might appear. This also might cause confusion, because the user wouldn't be able to differentiate between such items and the ones that he created. There is a possibility of redundancy of items too.
Solution: Semi-Automatic approach
2. Semi-Automatic approach:
Emails should be parsed only when the user selects to read them i.e. when the msg is displayed in the Detail view and the item should be stamped with user's consent.
The
Workflow is as follows :
- Parse the body text of an email in the "In" folder only when the user selects it.
- Only if some date/time information is found, prompt the user (by displaying a dialog box) to do one of the following:
* Stamp it as an event by clicking the Calendar Event icon
* Set a Reminder
* Do both
* Do nothing
- Stamp the item depending on the choice the user selects.
3. Manual approach:
Parse the email only when the user stamps it as an Calendar Event and set the date/time accordingly.
If no date/time information is found, stamp it as a anyTime event for today.
If more than one date/time is found (not in Ranges), prompt the user to select the appropriate date/time for the event/reminder.
Pros: The users have the freedom to stamp emails only if they want to or simply ignore it. This saves a lot of time since we need not parse each and every email the user reads.
Cons: Users might forget to stamp an email since they are not always reminded.
Proposed Solution
The default can be Manual approach.
We can have the user choose/change his preferences between semi-automatic and manual approach later.
Performance implications
Parsing text of 200 words takes 0.0071 seconds using
ParseDateTime library and 1000 words takes 0.025 seconds.
So the time taken to parse is better than linear time.
Issues
- Should we display to the user the fact that the email has been automatically stamped at some point of time ? If yes, how?
- If multiple dates and times exist in the email, what date/time should we set for the event ?
- In Manual approach, should we have a Button 'Parse Dates/Times' in the Detail view which will allow the user to explicitly search the email for dates/times.
--
DarshanaChhajed - 18 Sep 2006