-
Notifications
You must be signed in to change notification settings - Fork 488
Add tests to cover Finnish dates with 'klo' #1301
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
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## master #1301 +/- ##
==========================================
- Coverage 96.60% 0.00% -96.61%
==========================================
Files 235 235
Lines 2889 2889
==========================================
- Hits 2791 0 -2791
- Misses 98 2889 +2791 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
- Add "klo" to skip tokens in Finnish language data files - Modified: dateparser/data/date_translation_data/fi.py - Modified: dateparser_data/supplementary_language_data/date_translation_data/fi.yaml - Add translation test case for Finnish dates with "klo" - Modified: tests/test_languages.py This fixes parsing of Finnish dates like "28 maalis klo 9:37" (March 28 at 9:37). The word "klo" (abbreviation for "kello", meaning "o'clock") is now properly skipped during tokenization, allowing correct date parsing.
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.
Pull request overview
This PR adds support for Finnish date parsing with the word "klo" (abbreviation for "kello", meaning "clock" or "at" in time expressions). The changes add "klo" to the skip list for Finnish translation data and include comprehensive test coverage.
Changes:
- Added "klo" to the skip list in Finnish translation data files
- Added test cases covering various Finnish date formats with and without "klo"
- Added translation test to verify "klo" is properly skipped during translation
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/test_languages.py | Added translation test for Finnish date with "klo" to verify it's skipped during translation |
| tests/test_date_parser.py | Added 5 test cases covering Finnish dates with "klo" in various formats (abbreviated months, numeric dates) |
| dateparser_data/supplementary_language_data/date_translation_data/fi.yaml | Added "klo" to the skip list for Finnish translation |
| dateparser/data/date_translation_data/fi.py | Added "klo" to the skip list in the compiled Python translation data |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
939eeef to
cb64f2d
Compare
| param("fi", "su joulu 16, 2015", "sunday december 16 2015"), | ||
| param("fi", "1. tammikuuta, 2016", "1. january 2016"), | ||
| param("fi", "tiistaina, 27. lokakuuta 2015", "tuesday 27. october 2015"), | ||
| param("fi", "28 maalis klo 9:37", "28 march 9:37"), |
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.
I have created an issue where we can fix it - #1302
Close #1268