Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken in 0.7.3 : date not detected with specific surrounding text #178

Open
stevendavis opened this issue Oct 19, 2022 · 1 comment
Open

Comments

@stevendavis
Copy link

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
Copy link

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"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants