Closed lopuhin closed 4 years ago
And some other common examples which should return None
I think:
In [151]: dateparser.parse('of a')
Out[151]: datetime.datetime(2019, 1, 20, 0, 0)
In [152]: dateparser.parse('of an')
Out[152]: datetime.datetime(2019, 1, 20, 0, 0)
In [153]: dateparser.parse('an')
Out[153]: datetime.datetime(2019, 1, 20, 0, 0)
In [154]: dateparser.parse('a')
Out[154]: datetime.datetime(2019, 1, 20, 0, 0)
In [159]: dateparser.parse('a', settings={'STRICT_PARSING': True}, languages=['en'])
Out[159]: datetime.datetime(1900, 1, 1, 1, 0)
In [160]: dateparser.parse('an', settings={'STRICT_PARSING': True}, languages=['en'])
Out[160]: datetime.datetime(1900, 1, 1, 1, 0)
dateparser
considers as valid when all tokens are separators, and if so, the default date value the current date.
Hi @lopuhin . As the original ticket was fixed by @rennerocha , I decided to create a new ticket: https://github.com/scrapinghub/dateparser/issues/655 containing your second comment avoiding confusion. :)
Thank you @noviluni
I would expect
None
to be returned.