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

Issue/912 rel dates err ind #1094

Merged
merged 4 commits into from Nov 10, 2022
Merged
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
6 changes: 4 additions & 2 deletions dateparser/data/date_translation_data/id.py
Expand Up @@ -193,7 +193,8 @@
],
"\\1 month ago": [
"(\\d+[.,]?\\d*) bln lalu",
"(\\d+[.,]?\\d*) bulan yang lalu"
"(\\d+[.,]?\\d*) bulan yang lalu",
"(\\d+[.,]?\\d*) bulan lalu"
],
"\\1 second ago": [
"(\\d+[.,]?\\d*) detik yang lalu",
Expand All @@ -205,7 +206,8 @@
],
"\\1 year ago": [
"(\\d+[.,]?\\d*) tahun yang lalu",
"(\\d+[.,]?\\d*) thn lalu"
"(\\d+[.,]?\\d*) thn lalu",
"(\\d+[.,]?\\d*) tahun lalu"
],
"in \\1 day": [
"dalam (\\d+[.,]?\\d*) h",
Expand Down
Expand Up @@ -28,3 +28,10 @@ relative-type:
- sehari
0 second ago:
- baru saja

relative-type-regex:
\1 month ago:
- (\d+[.,]?\d*) bulan lalu

\1 year ago:
- (\d+[.,]?\d*) tahun lalu
5 changes: 5 additions & 0 deletions tests/test_freshness_date_parser.py
Expand Up @@ -463,6 +463,11 @@ def test_relative_past_dates_with_time_as_period(self, date_string, ago, period)
param("před 12 lětom 15 měsac", ago={'years': 12, 'months': 15}, period='month'),
# hy
param("15 րոպե առաջ", ago={'minutes': 15}, period='day'),
# id
param("4 tahun lalu", ago={'years': 4}, period='year'),
param("4 thn lalu", ago={'years': 4}, period='year'),
param("4 bulan lalu", ago={'months': 4}, period='month'),
param("4 bln lalu", ago={'months': 4}, period='month'),
# is
param("fyrir 3 ári fyrir 2 mánuði", ago={'years': 3, 'months': 2}, period='month'),
# it
Expand Down