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

REPLACEMENTS not comprehensive enough? #193

Open
julianss opened this issue Aug 29, 2023 · 0 comments
Open

REPLACEMENTS not comprehensive enough? #193

julianss opened this issue Aug 29, 2023 · 0 comments

Comments

@julianss
Copy link

julianss commented Aug 29, 2023

There are a lot of words that are recognized by the regex such as the "positionnal tokens", "extra tokens" and so on. But then when they have to be parsed by dateutils it fails. Take for example this date which isn't recognized when preceded by "last" but is recognized when preceded by "by".

In [126]: [x for x in datefinder.find_dates("last Mar-31-2023", source=True)]
Out[126]: []

In [127]: [x for x in datefinder.find_dates("by Mar-31-2023", source=True)]
Out[127]: [(datetime.datetime(2023, 3, 31, 0, 0), 'by Mar-31-2023')]

There is a REPLACEMENTS dict that strips problematic words. Shouldn't this dict be made more encompassing as to strip all the possible words that are recognized by the regex, or I am I missing something?

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

1 participant