scrapinghub / dateparser

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

"day after tomorrow" = "tomorrow" #933

Open koaning opened 3 years ago

koaning commented 3 years ago

It seems that the search_dates function has a bit of trouble with "day after tomorrow".

from dateparser.search import search_dates

search_dates("day after tomorrow")
[('tomorrow', datetime.datetime(2021, 6, 5, 11, 14, 16, 941615))]

dateparser.__version__
'1.0.0'

It seems to overfit on "tomorrow". The parse API also has a bit of difficulty with it.

from dateparser import parse
parse("day after tomorrow")   # None
serhii73 commented 1 year ago

Looks like parse is working now:

In [2]: parse("day after tomorrow")
Out[2]: datetime.datetime(2022, 11, 27, 12, 19, 15, 250488)

But we can still improve search_dates:

In [4]: search_dates("day after tomorrow")
Out[4]: [('tomorrow', datetime.datetime(2022, 11, 26, 12, 19, 31, 698468))]