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

Date extractor issue for a particular case #391

Open
elmaestro08 opened this issue Mar 5, 2019 · 1 comment
Open

Date extractor issue for a particular case #391

elmaestro08 opened this issue Mar 5, 2019 · 1 comment
Labels

Comments

@elmaestro08
Copy link
Contributor

For the date extraction of dates in the form '11/2018' and '12/2018' where the year can change the following code of date extraction returns no extractions:

event_date = doc.select_segments(jsonpath='$.Date')
extractions = doc.extract(extractor=self.date_extractor, extractable=event_date[0])

In the above snippet 'Date' is the field of the document. The above code works for all the other months from '1/2018' to '10/2018' but typically fails for November and December.

@elmaestro08
Copy link
Contributor Author

The workaround I used to fix this,

event_date = doc.cdr_document.get('Date')
event_date = '-'.join(event_date.split('/')[::-1])
extractions = self.date_extractor.extract(event_date)

@GreatYYX GreatYYX added the bug label Jul 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants