bear/parsedatetime — pull request #16 by jstegle (2013-05-29 14:04:03+00:00)
Title: Units detection update

Hi,

This commit fixes multilingual problem upon time units selection. Instead of checking the unit using startswith and endswith, it detects the associated time unit based on the locale time unit the regex matched.

I.E: For {'weeks': ['semaine','sem']} (FR locale), the code will now check for the associated key that contains 'semaine', in this case 'weeks'.

I've also moved up some checks on date type detection. Units will now be checked before date types. It prevents cases where months names can be contained in time units, for example:
'mai' (May) can be contained in 'semaine', which is a time unit.
Moving checks appeared to be easier than updating all of regular expressions affected by this problem.

Hope this helps,
Keep up the good work, this package kinda saved my day for managing relative dates,

Julien Stegle