Skip to content

Sanitize Russian year abbreviation written without a trailing period - #1354

Open
Sanjays2402 wants to merge 1 commit into
scrapinghub:masterfrom
Sanjays2402:fix/russian-year-abbreviation-without-period
Open

Sanitize Russian year abbreviation written without a trailing period#1354
Sanjays2402 wants to merge 1 commit into
scrapinghub:masterfrom
Sanjays2402:fix/russian-year-abbreviation-without-period

Conversation

@Sanjays2402

Copy link
Copy Markdown

Closes #1229

sanitize_date only 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 to year and 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 like 5 г назад are unaffected.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can't parse "09/08/2021г" or "09/08/2021г"

2 participants