scrapinghub / dateparser

python parser for human readable dates
BSD 3-Clause "New" or "Revised" License
2.55k stars 465 forks source link

"in three weeks" doesn't work #291

Closed sils closed 4 years ago

sils commented 7 years ago
In [2]: dateparser.parse('in two weeks')
Out[2]: datetime.datetime(2017, 3, 31, 23, 42, 45, 268823)

In [3]: dateparser.parse('in three weeks')

In [4]: dateparser.parse('in 3 weeks')
Out[4]: datetime.datetime(2017, 4, 7, 23, 42, 53, 854388)
atultherajput commented 7 years ago

Yeah, It is not working for more than two days, weeks, months and years . Examples:

But these are working:

I think it is because of this:- https://github.com/scrapinghub/dateparser/blob/master/data/languagefiles/en.yaml

`simplifications:

`

atultherajput commented 7 years ago

I had submitted a fix for this issue. Now we can parse upto twelve. #299 This is my first commit to this project so kindly review this patch @waqasshabbir

asadurski commented 7 years ago

Hi! Thanks for bringing that up. The issue is related to https://github.com/scrapinghub/dateparser/issues/46 (and I even have a quite stale branch for that, that I haven't worked on for a while: https://github.com/scrapinghub/dateparser/tree/feature-numerals-to-numbers). It's actually a bit complicated to solve it for more languages than just English. But of course @atultherajput's input is very welcome here for a good start.

atultherajput commented 7 years ago

Hey @asadurski I would like to work on this issue. I think we can use CLDR database for that.

AshwiniPatil5 commented 6 years ago

I'm using the pip install to get the dateparser. is this issue fixed in the latest version?

Gallaecio commented 4 years ago

Since this specific issue has been fixed, let us keep track of this at #46.