Repository navigation
Updated Czech localization - #1172
Merged
Merged
Conversation
Contributor
- Add month locative/dative forms (lednu, únoru, březnu, dubnu, květnu, červnu, červenci, srpnu, říjnu, prosinci) for dates like "v lednu 2023" - Add July abbreviation "črv" - Fix "za měsíc/týden/rok" not parsing: add accusative simplification patterns (previous patterns only matched instrumental -em forms) - Add tests covering the new expressions Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1172 +/- ##
=======================================
Coverage 97.11% 97.11%
=======================================
Files 235 235
Lines 2909 2909
=======================================
Hits 2825 2825
Misses 84 84 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
wRAR
approved these changes
Jun 22, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves Czech (cs) translation/normalization data so common grammatical variants (e.g., accusative forms used with “za” and locative month forms used with “v”) translate correctly into the project’s English-like intermediate representation used by dateparser’s parsing pipeline.
Changes:
- Added Czech simplification rules so phrases like
za týden / za měsíc / za roktranslate toin 1 week / in 1 month / in 1 year. - Expanded Czech month token lists with additional declensions (e.g.,
lednu,únoru,červenci, etc.) to support inputs likev lednu. - Added/extended regression tests covering the new Czech phrases.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
tests/test_languages.py |
Adds translation regression tests for new Czech phrases (za ..., v <month>). |
dateparser/data/date_translation_data/cs.py |
Extends Czech month tokens and adds simplification regexes for accusative forms after za. |
dateparser_data/supplementary_language_data/date_translation_data/cs.yaml |
Mirrors the added month declensions and za ... simplifications in supplementary YAML data used to generate bundled locale data. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Collaborator
|
Thanks! |
serhii73
added a commit
that referenced
this pull request
Jun 23, 2026
* Improve Czech (cs) language data (#1172) - Add month locative/dative forms (lednu, únoru, březnu, dubnu, květnu, červnu, červenci, srpnu, říjnu, prosinci) for dates like "v lednu 2023" - Add July abbreviation "črv" - Fix "za měsíc/týden/rok" not parsing: add accusative simplification patterns (previous patterns only matched instrumental -em forms) - Add tests covering the new expressions Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * italian: support 'un ora fa', 'un'ora fa', 'oggi alle 11:00'. Finishes PR #1049 and resolves conflicts with master: - Keep master's improved "(\d+[.,]?\d*)\s+ora" simplification and add a new one mapping "un ora"/"un'ora" to "1 ore". - Anchor the new simplification with word boundaries (\bun[' ]ora\b) so it no longer corrupts words such as "un orario" / "ciascun orario". - Add "alle" to the skip tokens so "oggi alle 11:00" parses as "oggi 11:00". - Regenerate it.py from it.yaml. - Drop an accidental duplicate test line from the original PR and add a regression test that locks in the word-boundary fix. Co-Authored-By: Serhii A <serhii@zyte.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Serhii A <aserhii@protonmail.com> Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: Serhii A <serhii@zyte.com>
serhii73
added a commit
that referenced
this pull request
Jul 29, 2026
* Improve Czech (cs) language data (#1172) - Add month locative/dative forms (lednu, únoru, březnu, dubnu, květnu, červnu, červenci, srpnu, říjnu, prosinci) for dates like "v lednu 2023" - Add July abbreviation "črv" - Fix "za měsíc/týden/rok" not parsing: add accusative simplification patterns (previous patterns only matched instrumental -em forms) - Add tests covering the new expressions Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * Do not read the day as a two-digit year after the year position (Close #519) In year-first date orders (e.g. YMD, used by the Japanese locale), parse_number tried the %y directive on every two-digit number, so in "4月20日 18:10" the day 20 was consumed as the year 2020 and the day was silently filled from the current date. If a component that the date order places after the year has already been found, the year position in the date string has already been passed, so a two-digit number is now read as a year only if it cannot be any other component (e.g. 99 in "4-99"). --------- Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Merged
serhii73
added a commit
that referenced
this pull request
Aug 28, 2026
) * Improve Czech (cs) language data (#1172) - Add month locative/dative forms (lednu, únoru, březnu, dubnu, květnu, červnu, červenci, srpnu, říjnu, prosinci) for dates like "v lednu 2023" - Add July abbreviation "črv" - Fix "za měsíc/týden/rok" not parsing: add accusative simplification patterns (previous patterns only matched instrumental -em forms) - Add tests covering the new expressions Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * Reject a %j day of year that the parsed year does not have datetime.strptime resolves a day of year past the end of the parsed year into the next year, so day 366 of a non-leap year became January 1 of the following year: >>> dateparser.parse("1999366", date_formats=["%Y%j"]) datetime.datetime(2000, 1, 1, 0, 0) The returned year contradicted the year in the input, and invalid values were rejected inconsistently: day 367 gave None while day 366 gave a date. The std lib keeps the value it read for %j in struct_time.tm_yday even after rolling the date into the next year, so the rollover can be spotted by comparing it with the day of year of the resulting date. When the two differ, strptime() now raises ValueError, which parse_with_formats() already handles as "this format does not match". _prepare_format() now also reports whether the format holds a real %j directive, so that an escaped "%%j" literal is not mistaken for one. Fixes #271. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
serhii73
added a commit
that referenced
this pull request
Sep 16, 2026
) * Improve Czech (cs) language data (#1172) - Add month locative/dative forms (lednu, únoru, březnu, dubnu, květnu, červnu, červenci, srpnu, říjnu, prosinci) for dates like "v lednu 2023" - Add July abbreviation "črv" - Fix "za měsíc/týden/rok" not parsing: add accusative simplification patterns (previous patterns only matched instrumental -em forms) - Add tests covering the new expressions Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * Find a date written next to a relative one without a comma (#695) search_dates('Today 13 Feb 2020') found no dates at all, while 'Today, 13 Feb 2020' found both. A chunk that does not parse as one date is split by looking for a separator that the translation and the text it was translated from hold the same number of times, and "today" is translated into "0 day ago": the translation gains two spaces the text never had, so the whitespace splitter is refused and the whole chunk is dropped. The comma form works because the comma survives the translation one for one. Cut such a chunk where the relative expression ends instead. The cut is taken only when the expression sits at one end of the chunk, when the rest of the translation keeps one word per remaining original word, when the word at that end really is the one the expression was translated from -- which the locale is asked to confirm by translating it on its own -- and when what is left of the chunk is a date. A chunk that fails any of these is left alone rather than cut at a guess, which is why 'Today 13 Feb 2020 and 14 Mar 2021', whose "and" the translation drops, still finds nothing. The cut is only looked for when no separator lined up, so a chunk that splits today keeps splitting exactly the way it does now. Fixes #695 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In some cases, there's some inconsistencies with Czech grammar. For example, in English:
In a monthwill output a correct datetime object - 1 month from now. But in Czechza měsícwon't print anything, butpříští měsícwill. Both are correct Czech sentences.The same proposed changes applies to
za týden(in a week),za hodinu(in a hour),příští rok(next year).Added new words:
In two days -
pozítříTwo days ago -
předevčíremLast year -
loniorvloniAnd finally, added some new declensions of initial words.