Skip to content

[RU] Fix the words dropped by render errors - #2843

Merged
BoboTiG merged 1 commit into
reader-dict:mainfrom
monosans:fix/ru-render-errors
Nov 16, 2026
Merged

BoboTiG merged 1 commit into
reader-dict:mainfrom
monosans:fix/ru-render-errors

Conversation

@monosans

Copy link
Copy Markdown
Contributor

A RU render of the 20261101 dump fails on four words, and they are missing from the dictionary:

  • радиан, перплексия: strip_examples() counted the braces inside <math> as template ones (2^{-P(x)log{P(x)}}), so the example was cut in the middle of the formula and an unclosed <math> was left. Braces inside <math>, <chem>, <nowiki> and comments are skipped now.
  • хамов: the page writes {{мест ru 1a-в‎ with a trailing U+200E. transform_variant() strips it from the name, but RU registered the name with only .strip(), so the lookup failed with a KeyError. The name is stripped the same way now. ES, EU, LT, NL, NO, PL, PT and SV had the same .strip(), so they get the same fix. The other languages already strip U+200E.
  • спаться: Шаблон:гл ru 5b/c"-ся has an unclosed {{#if: on Wiktionary, so it expands to a raw {{Гл-блок ... call. That text was taken as a {| table and gave junk forms like "=спимся" and "Вы", and then an IndexError. Only output that starts with {| is read as a wikitable now. The word is kept, without forms until the template is fixed upstream.

Testing

  • RU dump 20261101, Python 3.13 (python:3.13-slim in Docker) on Windows 11.
  • The four words parse now. Main against this branch, parse_word() on all 103 pages with <math> and random samples of 2,500 verbs, 2,500 nouns and all 393 pronouns: only радиан and перплексия changed (an error before, a definition now).
  • tests/test_ru.py, RU doctests, mypy and ruff pass.

@BoboTiG
BoboTiG merged commit 0c4ccb8 into reader-dict:main Nov 16, 2026
1 check passed
@BoboTiG

BoboTiG commented Nov 16, 2026

Copy link
Copy Markdown
Member

Nice!

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.

2 participants