← Back to team overview

gtg-contributors team mailing list archive

Re: proposed library

 

I had a look in their code:

A good news and a bad one. 
Good news first: it supports localization.
Bad news: only four localizations have been written.
          Every locale is a separate class
          http://code.google.com/p/parsedatetime/source/browse/trunk/parsedatetime/parsedatetime_consts.py?spec=svn85&r=85

          It does have some funny variables like:
self._leapYears = [ 1904, 1908, 1912, 1916, 1920, 1924, 1928, 1932, 1936, 1940, 1944,
                            1948, 1952, 1956, 1960, 1964, 1968, 1972, 1976, 1980, 1984, 1988,
                            1992, 1996, 2000, 2004, 2008, 2012, 2016, 2020, 2024, 2028, 2032,
                            2036, 2040, 2044, 2048, 2052, 2056, 2060, 2064, 2068, 2072, 2076,
                            2080, 2084, 2088, 2092, 2096 ]

I'm generally against "reinventing the wheel", but since we use only a subset of
their features, we could write something more easily localizable.


On Wed, Feb 24, 2010 at 10:41:36AM +0100, Bertrand Rousseau wrote:
> Hi,
> 
> Natural date parsing is a really exciting feature. It would be
> interesting to play with it. However, one major issue I see with this
> feature is localization. Do this library support several locales?
> 
> I think localization-aware natural date parsing is a not an easy
> feature. It could be worth including it in GTG dependancies, then (at
> least if the package is well maintained).
> 
> Bertrand
> 
> On Wed, Feb 24, 2010 at 10:37 AM, Luca Invernizzi
> <invernizzi.l@xxxxxxxxx> wrote:
> > Hi all,
> > I found out a nice library in the ubuntu repository to parse times in
> > "human"format.
> >
> > The name is python-parsedatetime, and from their home page
> > (http://code.google.com/p/parsedatetime/):
> > parsedatetime is able to parse, for example, the following:
> > August 25th, 2008
> > 25 Aug 2008
> > Aug 25 5pm
> > 5pm August 25
> > next saturday
> > tomorrow
> > next thursday at 4pm
> > at 4pm
> > eod
> > tomorrow eod
> > eod tuesday
> > eoy
> > eom
> > in 5 minutes
> > 5 minutes from now
> > 5 hours before now
> > 2 hours before noon
> > 2 days from tomorrow
> >
> >
> > I'm not saying that we should add that as dependency, but maybe we could
> > "steal" some code.
> >
> >
> >
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v1.4.9 (GNU/Linux)
> >
> > iQIcBAEBCAAGBQJLhPM+AAoJEJwV7kAnLtWzl6sQAML/my+EMuA4hSzHrlE99uBx
> > xNzVGyEe1eDChcsZ97rbcvUB0Qc9ejz8h3tm7+z58CFzvLArlyo3Eq67BfHdOBQl
> > /lpu2pephR0EaOUv6AUOodmr3vrmnaVAMUFGPYC4Fw9t5DbuSnUXCKut0r6LVIIv
> > YY+zIL9MsLHuOlzSXeiU5x6OV2JWYfSkLvhYclP/jc6aU904Kaek0TuJIE36R3am
> > V+FxOEoDHjsYZRc65nrO+wF10T5TIi7cEqmLZwHaiaeqlG9MicfAmW7J1Ehyv7R0
> > kwyVlU3hspqdkzq/eU4yNMjz9jM4PlJQuMgUGZdO66JSvkNqylgC4DwReDVH+3Pa
> > 7z03mNs0HcuPqfHCn9+7/CyNaeC0IsLBnYlOgj46m7HHhckY2Psn//PQuZY1IL2+
> > mYGi3itTz3SHTxLPO1hNrj9rcZlyzPtq/0zkFjrkGbN4vBAaUcJI1SN5a6UikOIO
> > 0hAEYhUa9VgGbjmLjc4RYwdtqat+fd9OYBX+KTi5cw9lOj25valYtYVtn/0MDN/u
> > jja0KZ23RAaayvbsZ0lmhRJ2XSByFXSZHbFng5bR74dp5ASZBahiDtpxGxjzzSCX
> > 8H+Zon3yrdxGfb3tc4X5HxU6QSc16RJxvduUQS2jferEbpKoXWrvUEZVtAsTNmIl
> > brbDv1Stt1Gp2rERMrH+
> > =p4rC
> > -----END PGP SIGNATURE-----
> >
> > _______________________________________________
> > Mailing list: https://launchpad.net/~gtg-contributors
> > Post to     : gtg-contributors@xxxxxxxxxxxxxxxxxxx
> > Unsubscribe : https://launchpad.net/~gtg-contributors
> > More help   : https://help.launchpad.net/ListHelp
> >
> >
> 
> 
> 
> -- 
> Bertrand Rousseau

Attachment: signature.asc
Description: Digital signature


Follow ups

References