Seed a server dictionary from a bilingual dictionary JSONL #15
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority/Critical
Priority/High
Priority/Low
Priority/Medium
Reviewed/Confirmed
Reviewed/Duplicate
Reviewed/Invalid
Reviewed/Won't Fix
Status/Abandoned
Status/Blocked
Status/Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
project-halkyon/halkyon-curator!15
Loading…
Reference in a new issue
No description provided.
Delete branch "refs/pull/15/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Adds a German↔English / German↔Greek path to the server-side
dictionary_entriescatalog, alongside the existing JMdict seeder. This is what lets a private, self-hosted server hold its own dictionaries.bilingual_dictionary.dart— parser for a bilingual dictionary JSONL (one object per line:query,direction,entries[headword / wordClass / ipa / senses[label / translations / examples]]).bilingual_seed.dart— maps an entry to adictionary_entriesrow.language= the line'sdirection(de-en / en-de / de-el / el-de);expression= headword;reading= ipa;meanings/sensesfrom the translations, falling back to a headword example's target when a sense has no direct translation (common for some verbs/phrases). TolerantwordClass→posnormalisation and a deterministic FNV id so re-seeds upsert in place.dictionary_upload.dart— the batched PostgREST upsert extracted for reuse;seed_dictionary.dartnow calls it too (no behaviour change to the JMdict path).bin/seed_bilingual.dart— streams a large source file and upserts in batches on the(id, language)key (idempotent);--dry-runvalidates the built rows with no server.Why
The seeding pipeline (stream → build rows → idempotent upsert) was already there for JMdict; only a source parser was missing for other dictionaries. The shared lookup schema (
(id, language)PK,expression/reading/meanings/senses/pos/search_blob) carries non-Japanese entries unchanged.Verification
Unit tests cover the parse, the row mapping, the empty-translations example fallback,
wordClassnormalisation, id stability, and the skip rules.--dry-runvalidated row shapes against real input. Full suite green;dart analyzeclean.The live seed is an operational step (run when the target private project has the
dictionary_entriesschema + a service-role key); it is not part of this change.