Repository navigation
[DE] Show the synonyms under their meaning - #2838
Merged
Merged
Conversation
{{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.
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.
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: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.