Broken in 0.7.3 : date not detected with specific surrounding text
stevendavis opened this issue · 1 comments
stevendavis commented
These test cases pass with version 0.7.1 and fail with version 0.7.3
line = "as of June 30, 2019. Management"
assert list(find_dates(line)) == [datetime.datetime(2019, 6, 30)]
line = "As of November 30, 2020, management"
assert list(find_dates(line)) == [datetime.datetime(2020, 11, 30)]
These test cases pass with both version 0.7.1 and 0.7.3
line = "As of June 30, 2019, the"
assert list(find_dates(line)) == [datetime.datetime(2019, 6, 30)]
line = "outstanding as of November 30, 2020, is"
assert list(find_dates(line)) == [datetime.datetime(2020, 11, 30)]
NathanSmeltzer commented
I'm experience the same issue.
These strings return an empty generator:
"Your item departed our USPS facility in HARRISBURG, PA 17112 on December 22, 2022 at 5:58 am."
"17112 on December 22, 2022 at 5:58 am"
This returns the incorrect year:
"7112 on December 22, 2022 at 5:58 am"
It only works when shortening the string and removing any other numbers:
"on December 22, 2022 at 5:58 am"