[Chandler-dev] Date/time auto-completion patch

Mike Taylor bear at code-bear.com
Mon Aug 21 15:22:50 PDT 2006


On Aug 21, 2006, at 6:03 PM, Brian Kirsch wrote:

I know Brian was asking about the Chandler specific code, but wanted to 
point out some of the changes I was making to parsedatetime that may 
fit in.

> Hi Darshana,
> So to recap it sounds like the date / time portion of the parser is 
> leveraging ICU and
> thus when the locale is set to French can parse "Mardi" and treat it 
> equivalent to
> "Tuesday" if the locale was English.

That's the code I'm working on now in the parsedatetime library.

> However, if the locale was English and the parser encountered the word 
> "Mardi" it
> would not recognize it as a day of week token.
>
> Is this correct?

As it stands right now - correct.  That's not to say at some later 
point I could get fancy and allow for a list of locales to be "active" 
- but that's definitely v2.0 stuff and parsedatetime hasn't hit 1.0 yet 
:)

> How do the other natural language strings such as "dinner" get 
> localized?

Right now they are localized within parsedatetime itself.  The current 
code has a number of python lists that contain special words and 
phrases that are used during different parts of the parsing.

The new localizable code I'm working on moves those lists into a class 
that can be defined/overridden to define new locales.  I was thinking 
of allowing for a "register a word lookup function" to allow the lists 
to be initialized by running them thru that function to create the 
localized versions.

> Is this localization of natural language strings documented anywhere 
> such as Wiki?

This I don't know - I haven't documented parsedatetime's localize api's 
yet but will be generating those api docs when I finish the code.

---
Bear

Build and Release Engineer
Open Source Applications Foundation (OSAF)
bear at osafoundation.org
http://www.osafoundation.org

bear at code-bear.com
http://code-bear.com

PGP Fingerprint = 9996 719F 973D B11B E111  D770 9331 E822 40B3 CD29


-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : http://lists.osafoundation.org/pipermail/chandler-dev/attachments/20060821/4f1f35e3/PGP.pgp


More information about the chandler-dev mailing list