On Aug 28, 2006, at 7:13 PM, Mimi Yin wrote:
Forwarding to the design list...as an FYI---
Darshana and I have put together a laundry list of the regular expressions handled by the new date/time Natural Language Processor that was checked in last week?
Both Bear, Darshana have amended the wiki page with comments.
If your curious, take a look and add your own use cases in the Comments section at the bottom.
Thx!
Mimi
http://wiki.osafoundation.org/bin/view/Journal/DateTimeParsing
Begin forwarded message:
From: Mimi Yin <[EMAIL PROTECTED]>_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Date: August 28, 2006 10:36:44 AM PDT
To: [EMAIL PROTECTED], Jeffrey Harris <[EMAIL PROTECTED]>
Cc: Sheila Mooney <[EMAIL PROTECTED]>, Mike Taylor <[EMAIL PROTECTED]>
Subject: Re: Regular expressions for date/time widget
Hi Darshana,
I've compiled a list of regular expressions from what you gave me and I had a few questions. (See stuff in bold below). And I thought of some more as well... I've put it up on the wiki too: http://wiki.osafoundation.org/bin/view/Journal/DateTimeParsing
Thanks,
Mimi
===
Use Cases - Are we doing things like...
* in 3 hours/weeks/months/years
* in the next hour/week/month/year
* at a quarter of 4
* end of next week
* end of Tuesday
Prepositions
* in
* on
* of
* at
Modifier
* previous
* prev
* last
* next
* next next??
* this
* eo
* end of ??
* end\sof ??
* in/sa ??
Modifider 2
* from
* before
* after
* ago
* prior
How about??
* all, e.g. all morning
* late, e.g. late evening
* early, e.g. early afternoon
* top of the
* in the middle of
* just before
* just after
* a quarter of
* a quarter past
* half past
HH:MM:SS AM/PM
Can we accommodate the following?
* HH:MM AM/PM
* HH:MM
* H:MM
* H AM/PM
DD/MM/YY
DD/MM/YYYY
Abbreviations for Months and Days of the Week?
Months
* January
* February
* March
* April
* May
* June
* July
* August
* September
* October
* November
* December
Days of the Week
* Monday
* Tuesday
* Wednesday
* Thursday
* Friday
* Saturday
* Sunday
Relative Days
* Today
* Tomorrow
* Yesterday
Time of Day
* Breakfast
* Lunch
* Dinner
* Morning
* Noon
* Evening
* Tonight
* Night
* Now
* Midnight
How about??
* Afternoon
* Brunch
* Dawn
* Dusk
* Twilight
PREPOSITIONS = r'(?P<special>^[in|on|of|at]+)\s+'
UNITS = r'(?P<qty>(-?\d+\s*(?P<units>((hour|hr|minute|min|second|sec|day|dy|week|wk|month|mth|year|yr)s?))))'
SINGLE_CHAR_UNITS = r'(?P<qty>(-?\d+\s?(?P<qunits>h|m|s|d|w|m|y)(\s|,|$)))'
MODIFIER = r'(?P<modifier>(previous|prev|last|next|this|eo|(end\sof)|(in\sa)))'
MODIFIER2 = r'(?P<modifier>(from|before|after|ago|prior))'
# 5:50:00
TIMEHMS = r'(?P<hours>\d\d?)(?P<tsep>:)(?P<minutes>\d\d)(?:(?P=tsep)(?P<seconds>\d\d(?:[.,]\d+)?))?'
# 5:50:00 (am/pm)
TIMEHMS2 = r'(?P<hours>(\d\d?))((?P<tsep>:)(?P<minutes>(\d\d?))(?:(?P=tsep)(?P<seconds>\d\d?(?:[.,]\d+)?))?)?\s?(?P<meridian>(am|pm|a.m.|p.m.|a|p))'
# 07/21/06 (dd/mm/yy(yy))
DATE = r'(?P<date>((?P<yr>(\d\d\d\d))[/|.|\\|-](?P<mth>(\d\d?))[/|.|\\|-](?P<dy>(\d\d?))))'
# July 21st, 2006
DATE_STR = r'(?P<date>((?P<mthname>(january|jan|february|feb|march|mar|april|apr|may|june|jun|july|jul|august|aug|september|sep|october|oct|november|nov|december|dec))\s?((?P<day>\d\d?)(\s|rd|st|nd|th|,|$)+)?(?P<year>\d\d\d\d)?))'
MONTH = r'(?P<month>((?P<mthname>(january|jan|february|feb|march|mar|april|apr|may|june|jun|july|jul|august|aug|september|sep|october|oct|november|nov|december|dec))(\s?(?P<year>(\d\d\d\d)))?))'
WEEKDAY = r'(?P<weekday>(monday|mon|tuesday|tue|wednesday|wed|thursday|thu|friday|fri|saturday|sat|sunday|sun))'
NLP_DAY = r'(?P<day>(today|tomorrow|yesterday))'
NLP_TIME = r'\s*(?P<time>(morning|breakfast|noon|lunch|evening|midnight|tonight|dinner|night|now))'
Open Source Applications Foundation "Design" mailing list
http://lists.osafoundation.org/mailman/listinfo/design
Bear
Build and Release Engineer
Open Source Applications Foundation (OSAF)
[EMAIL PROTECTED]
http://www.osafoundation.org
[EMAIL PROTECTED]
http://code-bear.com
PGP Fingerprint = 9996 719F 973D B11B E111 D770 9331 E822 40B3 CD29
PGP.sig
Description: This is a digitally signed message part
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Open Source Applications Foundation "Design" mailing list http://lists.osafoundation.org/mailman/listinfo/design
