feat(vocabulary): mute the metadata woven into a bilingual gloss #825

Merged
raisondetredev merged 1 commit from refs/pull/825/head into main 2026-08-07 15:36:14 +02:00
raisondetredev commented 2026-08-07 15:36:04 +02:00 (Migrated from codeberg.org)

PONS prints an entry as Eingriff m <-s, -e> in +acc: the translation
itself, with the noun's gender, its inflection and the case it governs
set in italics beside it. The seed flattened all of that into one
string, so the app rendered the annotation as if it were part of the
meaning — a wall of undifferentiated text where the printed dictionary
had two levels of information.

splitGlossMetadata recovers the split so the annotation can render
muted italic, the same treatment the sense label and the JMdict
classifier tags already get. It reads by shape where the catalog is
unambiguous (<…> inflection groups, +acc-style case markers) and
otherwise against a closed set of the abbreviations the catalog actually
uses.

Abbreviations that double as ordinary words are only muted in company:
a region code counts as annotation next to another marker or in a run at
either end of the gloss, so Grammeln pl A annotates while Klasse A
reads as the translation it is. A gloss that comes out entirely metadata
is handed back as plain text — whatever it is, it is not an annotation
of nothing.

sensesAreBilingual gates the whole thing to the PONS-derived catalogs,
told apart from JMdict by their part-of-speech vocabulary (spelled-out
noun/adjective vs JMdict's n/v5r/adj-na). Without that gate
the short markers would eat ordinary English words in a JMdict gloss —
"old man", "art of war".

Both the structured senses view and the flat meanings list route through
the same helper, which returns a plain Text whenever there is nothing to
mute, so the widget tree (and find.text) is unchanged for every gloss
that reads as one run.

Signed-off-by: Tizian 「ティツィアーン」 raisondetredev@pm.me

PONS prints an entry as `Eingriff m <-s, -e> in +acc`: the translation itself, with the noun's gender, its inflection and the case it governs set in italics beside it. The seed flattened all of that into one string, so the app rendered the annotation as if it were part of the meaning — a wall of undifferentiated text where the printed dictionary had two levels of information. `splitGlossMetadata` recovers the split so the annotation can render muted italic, the same treatment the sense label and the JMdict classifier tags already get. It reads by shape where the catalog is unambiguous (`<…>` inflection groups, `+acc`-style case markers) and otherwise against a closed set of the abbreviations the catalog actually uses. Abbreviations that double as ordinary words are only muted in company: a region code counts as annotation next to another marker or in a run at either end of the gloss, so `Grammeln pl A` annotates while `Klasse A` reads as the translation it is. A gloss that comes out entirely metadata is handed back as plain text — whatever it is, it is not an annotation of nothing. `sensesAreBilingual` gates the whole thing to the PONS-derived catalogs, told apart from JMdict by their part-of-speech vocabulary (spelled-out `noun`/`adjective` vs JMdict's `n`/`v5r`/`adj-na`). Without that gate the short markers would eat ordinary English words in a JMdict gloss — "old man", "art of war". Both the structured senses view and the flat meanings list route through the same helper, which returns a plain Text whenever there is nothing to mute, so the widget tree (and `find.text`) is unchanged for every gloss that reads as one run. Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
project-halkyon/halkyon-learn!825
No description provided.