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

Russian abbreviation weekdays #484

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 10 additions & 3 deletions dateparser/data/date_translation_data/ru.py
Expand Up @@ -66,34 +66,41 @@
],
"monday": [
"понедельник",
"пн"
"пн",
"Пнд"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not related to this PR, but I'm curious if case matters here, and why is пн lower but Пнд capitalized?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capitalization doesn't matter when processing dates. However, If we add two different versions of the same word both are added to the py file. This is going to be fixed in this PR by @asadurski: #487

],
"tuesday": [
"вторник",
"вт"
"вт",
"Втр"
],
"wednesday": [
"среда",
"ср",
"Срд",
"Среду"
],
"thursday": [
"четверг",
"чт"
"чт",
"Чтв"
],
"friday": [
"пятница",
"пт",
"Птн",
"Пятницу"
],
"saturday": [
"суббота",
"сб",
"Сбт",
"Субботу"
],
"sunday": [
"воскресенье",
"вс",
"Вск",
"Воскресение"
],
"am": [
Expand Down
Expand Up @@ -2,13 +2,23 @@ skip: ["около", "в", "и"]

sentence_splitter_group : 1

monday:
- Пнд
tuesday:
- Втр
wednesday:
- Срд
- Среду
thursday:
- Чтв
friday:
- Птн
- Пятницу
saturday:
- Сбт
- Субботу
sunday:
- Вск
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw, another common one is Вскр

- Воскресение

february:
Expand Down
3 changes: 3 additions & 0 deletions tests/test_date_parser.py
Expand Up @@ -91,6 +91,9 @@ def setUp(self):
param('13 авг. 2005 19:13', datetime(2005, 8, 13, 19, 13)),
param('13 авг. 2005г. 19:13', datetime(2005, 8, 13, 19, 13)),
param('13 авг. 2005 г. 19:13', datetime(2005, 8, 13, 19, 13)),
param('Пнд, 07 янв. 2019 г. 12:15', datetime(2019, 1, 7, 12, 15)),
param('Срд, 09 янв. 2019 г. 12:15', datetime(2019, 1, 9, 12, 15)),
param('Птн, 11 янв. 2019 г. 12:15', datetime(2019, 1, 11, 12, 15)),
# Turkish dates
param('11 Ağustos, 2014', datetime(2014, 8, 11)),
param('08.Haziran.2014, 11:07', datetime(2014, 6, 8, 11, 7)), # forum.andronova.net
Expand Down