Natural Language Parsing in Detail view of Calendar
The project is about natural language date/time parsing in Chandler
The date/time widgets in the Detail View
of the Calendar can parse the dates and times only in one specific format. Also, they do not understand natural language date/time strings.They provide very little or no support for auto-completion of recognizable strings.
The goal of this project is to enhance Chandler by allowing the users to enter any of the widely accepted date/time formats, natural language date/time strings, weekdays, month names, etc in the date/time widgets in the detail view of the Calendar in Chandler. It also supports i18n and l10n.
Original Project Proposal
- ParseDateTime library:
The parsedatetime library is used to perform the natural language parsing. It can parse 'human readable' date and time text.
It is a stand-alone module which can be downloaded from Python Cheeseshop, Google and the project page.
This library uses regular expressions to parse many different formats of natural language dates/times and ranges. It uses PyICU, if available. Support is provided for date/times in different locales.
- Integration with Chandler:
The text entered in the date/time widgets in Chandler is parsed by the parsedatetime library. Auto-completion is provided for the recognizable date/time strings. A list of all the possible string matches comes up depending on what the user enters. The first completion match in the list is automatically selected.
To read about how this is actually done, go to Enhancing Attribute Editors.
Working of the Date/Time widgets now
- Typing 'tomorrow' in the date fields in the Chandler Detail view would set the date as tomorrow's date.
The date related text that is currently parsed is today, tomorrow, yesterday, weekdays and month names.Also strings like "This week", "EOW" or "Next/last/this Wednesday" can be parsed
- Typing weekday names in the date field would set the date to the next occurance of that weekday
- Typing 'lunch' in the time fields in the Chandler Detail view would set the time as 12:00 PM.
The time related text that is currently parsed is morning(6am), breakfast(8am), noon and lunch(12pm), evening(6pm), dinner (7pm), night and tonight(9pm) and midnight(12am)
- Incomplete date/time or different date/time formats are also recognized
* 5p would be 5:00 PM
* 5pm would be 5:00 PM
* 20/7 would be 20/07/2006
* 5.5.06 would be 05/05/2006
- A '?' appears at the end of the date/time strings which are not recognised (or parsed)
Related Documentation links