datefinder icon indicating copy to clipboard operation
datefinder copied to clipboard

Broken in 0.7.3 : date not detected with specific surrounding text

Open stevendavis opened this issue 2 years ago • 1 comments

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)]

stevendavis avatar Oct 19 '22 19:10 stevendavis

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"

NathanSmeltzer avatar Dec 22 '22 19:12 NathanSmeltzer