Skip to content

Month and Month Year (e.g. April and May 2019) will return None #507

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

Open
FBosler opened this issue Mar 3, 2019 · 2 comments
Open

Month and Month Year (e.g. April and May 2019) will return None #507

FBosler opened this issue Mar 3, 2019 · 2 comments

Comments

@FBosler
Copy link

FBosler commented Mar 3, 2019

I pieces of text where there are often two months concatenated by an "and" and then a year.

Like:
April and May 2019or
June and July 2018

I could not really figure out how to get at least one date out of it by using search_dates and settings 'PREFER_DAY_OF_MONTH' only works if its 'Month Year' and not 'Month and Month Year'

@IMP1
Copy link

IMP1 commented Jun 11, 2019

I'm also getting unwanted results from these sort of 'date combinations'.

My text includes June & August 1967, and this is returning the current June, and ignoring the August (and more importantly, the year).

It would be nice to recognise these sort of date combinations, but I'm not sure which date should be returned from parsing these strings.

@FBosler: Do you think 2019/4/1 or 2019/5/1 should be returned from your first example? Or a list of dates, which would change the parse return type and wouldn't necessarily be backwards-compatible.

I definitely think dateparser.search.search_dates should return both/all of these dates, using the year for all of them, but for dateparser.parse I don't know which one should be chosen. Maybe it should just be the last one, or maybe this could have a setting to determine which is returned.

@FBosler
Copy link
Author

FBosler commented Jun 11, 2019

If I remember correctly search_dates returns a list anyway. So at least to me it would be intuitive, if it were to return two dates according to the other settings like PREFER_DAY_OF_MONTH

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

No branches or pull requests

4 participants