Sanitize Russian year abbreviation written without a trailing period - #1354
Open
Sanjays2402 wants to merge 1 commit into
Open
Sanitize Russian year abbreviation written without a trailing period#1354Sanjays2402 wants to merge 1 commit into
Sanjays2402 wants to merge 1 commit into
Conversation
sanitize_date only stripped the Russian year marker when it was written as 'г.'; a string ending in a bare 'г' (e.g. '09/08/2021г') kept the letter, which was then translated to the word 'year' and parsed as a relative year expression instead of the given date. Add a second pass that removes 'г' when it directly follows a four-digit year and is not part of a longer word or an abbreviation with a period, so 'год', 'года' and relative forms like '5 г назад' are untouched. Closes scrapinghub#1229
AdrianAtZyte
approved these changes
Jul 28, 2026
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.
Closes #1229
sanitize_dateonly strips the Russian year marker when it is written asг., so a string ending in a bareг(09/08/2021г,09/08/2021 г) kept the letter, which was then translated toyearand parsed as a relative year expression rather than the given date.The added pass removes
гonly when it directly follows a four-digit year and is not part of a longer word or a dotted abbreviation, soгод/годаand relative forms like5 г назадare unaffected.