-
Notifications
You must be signed in to change notification settings - Fork 465
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
Fix short weekday names #1214
base: master
Are you sure you want to change the base?
Fix short weekday names #1214
Conversation
Please check https://github.com/scrapinghub/dateparser/blob/master/CONTRIBUTING.rst#guidelines-for-editing-translation-data about editing language data (you edited a generated file). |
1e4c73c
to
30e2c7f
Compare
- Update en.yaml file to support two letters days of the week - #1170
Any idea about the failing test? |
- Develop method to remove_multiple_occurrences of the day(s) of the week - #1170
def remove_multiple_occurrences(self, date_str_tokens: list): | ||
# first occurrence of day of the week will be considered | ||
# followings occurrence(s) will be skipped and removed from the token list. | ||
weekdays_counter = 0 | ||
for i, token in enumerate(date_str_tokens): | ||
if token in self.weekdays: | ||
weekdays_counter += 1 | ||
|
||
if weekdays_counter > 1: | ||
date_str_tokens.pop(i) | ||
continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting solution. I imagine it is not perfect, but if current tests pass, onward! We can always iterate on it later.
Could you add tests for the fix itself? (7 dates with the short weekday form that are properly parsed) I think that’s all that’s left. |
Fixes #1170