Skip to content

[PL] Show the synonyms under their meaning - #2851

Merged
BoboTiG merged 1 commit into
reader-dict:mainfrom
monosans:feat/pl-synonyms-under-meaning
Nov 26, 2026
Merged

BoboTiG merged 1 commit into
reader-dict:mainfrom
monosans:feat/pl-synonyms-under-meaning

Conversation

@monosans

Copy link
Copy Markdown
Contributor

Follow-up to #2815. On pl.wiktionary each synonyms line starts with the numbers of its meanings, like : (1.1) [[trusia]] on królik. The dictionary showed them as a separate "Synonimy" list with the numbers stripped, so you couldn't tell which meaning a synonym was for.

Now they go under their meaning as a syn.: sub-definition, like for RU, UK, NL, CS, DE and JA. Handled: (1.1), (1.1-2), (1.1-1.3), (1.1, 2.1), (1.1,3), (1.4-5,7) and (1.1) (2.1). Several lines for the same meaning are joined with ;. The Polish and the international sections each have their own numbering, so each is matched on its own.

The list of a section is kept as it is when a line has no number (: {{gwara}} [[mliko]]), a number that isn't one of its meanings ((1), (1.1.2)), a range across parts of speech ((1.1-3.1)), or a number pointing to a meaning the dictionary doesn't show: a form of another word goes to the variants, and a part of speech like przyrostek is left out, so the synonyms would be lost with it.

Testing

  • PL dump 20261101, Python 3.13 (python:3.13-slim in Docker) on Windows 11.
  • parse_word() on all 180,287 pages that have a non-empty synonyms section, main against this branch: 38,313 of them show synonyms. 37,423 now get them under the meanings and 890 keep the list. No other definition changes and no errors on either side. No synonym is lost; in 6 pages the old list still had leftover numbers like "(2.1) (3.1) okej, okay", and those are gone now.
  • tests/test_pl.py (expectations for "a", "ABC", "książka" and "piękny" updated), the new doctests, mypy and ruff pass.

@BoboTiG

BoboTiG commented Nov 26, 2026

Copy link
Copy Markdown
Member

Thanks a lot @monosans !

@BoboTiG
BoboTiG merged commit 9475bdb into reader-dict:main Nov 26, 2026
1 check passed
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