Skip to content

[DE] Show the synonyms under their meaning - #2838

Merged
BoboTiG merged 1 commit into
reader-dict:mainfrom
monosans:de-synonyms
Nov 9, 2026
Merged

BoboTiG merged 1 commit into
reader-dict:mainfrom
monosans:de-synonyms

Conversation

@monosans

@monosans monosans commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Following up on #2815 for DE. There the synonyms don't follow the order of the meanings. Each line starts with the numbers of the meanings it belongs to: :[1] [[rasch]], :[1, 3] [[flink]], or a range of meanings. So this needed a new helper, utils.attach_numbered_synonyms(). It takes a regex for the numbers at the start of a line and puts each line of synonyms under every meaning it refers to:

1. eine hohe Geschwindigkeit habend
   a. Syn.: rasch
   b. Syn.: flink
2. ...

DE calls it right after {{Synonyme}} becomes a section title and before :[1] becomes #. The list stays as it is when one of its lines has no number (:''siehe auch:'' ...), or refers to something that isn't a meaning: a sub-meaning like [1a], [*], [?], or a number the meanings don't have. The categories at the end of a page are skipped.

On the 20261101 dump, 59,963 of the 60,592 German parts of speech with synonyms get them under their meanings, and 629 keep their list. On a sample of 1,500 pages, no meaning is lost, and 2 pages still have a separate synonyms list instead of 1,016.

The new function has doctests, and the "@", "Doppelkreuz (Zeichen)" and "Sinn" tests now expect the synonyms under their meanings. The DE tests pass with a DE dump, and the RU/UK/BG checks still pass.

There is a separate PR for CS (#2837), which has the RU layout.

{{Synonyme}} gives the numbers of the meanings in front of each line
(":[1, 2] [[flink]]"), so utils.attach_numbered_synonyms() puts each line under
the meanings it refers to.
@BoboTiG
BoboTiG merged commit 4b1b59b into reader-dict:main Nov 9, 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