← Back to team overview

gtg-contributors team mailing list archive

Re: proposed library

 

On Wed, Feb 24, 2010 at 11:14 AM, Luca Invernizzi
<invernizzi.l@xxxxxxxxx> wrote:
> 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 ]
>

Urgh! Let's hope someone will think to add more dates after 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.

After seeing what the code looks like, I think we'd better do this,
yes. Depending on a bad dependency will quickly become a nightmare of
workarounds.

>
> 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
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
>
> iQIcBAEBCAAGBQJLhPv1AAoJEJwV7kAnLtWzITgP/2j0fHLYdH/nk2sKmr9aM7vW
> 76RbRm06xxUzqItMYfYkWt9oA5TCWrFgI4xB3Y8IGDLR/4vXWuqAbye61ZzIXE6G
> aRObWU5gEav+P6h7GZ/kVAJ7GkhLYzO4cF1wNa1/83Q7fobUjIo9l5koF3HsRJ8y
> A/ikavjgqOzk6B8D9Q9fvTWQSx+KEWhTAmctcOD6CLYg0z+2Zeei0nb9qCXsaaDJ
> nAW5ThKGIbb1OjpA10NPNQ53xwgmxSpE4B8aRW1A63DNyiM+j4jd8+gQ7qtvwyU5
> L8f/pr8k6XWb678GHZxEks7XDcpdeppjz0qwjrSSugP1vJ9bnd1s2j39KEImLv0K
> +dOXXPegvw/8hF5hL9kAiri3V6ZaRcvqD14/Hpabb/8v30xar8PhOeJyayL1aHB9
> F5KSrymCfs6U8mc0Q+ypCUPe9EhC41lOsN2d2E1FsVF581b54vhFSyp5wnWzpmBK
> X1vX/U1ip6o97LIm1WrT+0kB9zBpFNtQML7c4lgBQiFEwARHoJ3e0bNK06sCWWiD
> vO4rZ2Y3UZbaf2a5/92x5x4koo9OuyfI0/jmzhTDBcia0G1v+v4lCEXU9+yZYHKV
> ZcB4omI351bMoRsOIQCL8CdexdN+FyNlaCd6/M+9wbXnPQtmJnIJI2jFAyk6VdBb
> cyP3HjrdnVhXfMhYBPk0
> =Pgrb
> -----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



References