feat(seed): tag Greek entries with HNC lemma-bulk membership #21
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!21
Loading…
Reference in a new issue
No description provided.
Delete branch "refs/pull/21/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
Populates the
hnc_lemma_words_<N>boolean columns ondictionary_entriesduring Greek seeding, so the app's "Top N most common words" bulk-add (500 … 5000) actually returns words. This is the Greek analogue of the Japanesejlptjoin.Why
The feature was already wired end-to-end except the population step: the 47 nested HNC frequency lists (
hnc_lemma_words_bulk_<N>.txt), the 47hnc_lemma_words_<N>columns, and thecount_dictionary_entries/add_dictionary_vocabularyRPCs +HncWordsFilterchips all exist. But nothing ever set the flags — the bilingual seeder emitted them implicitly-absent — so every Greek entry had them false and "Top N" returned nothing.How
HncLemmaBulks(lib/src/hnc_lemma_bulks.dart) — reads the nestedhnc_lemma_words_bulk_<N>.txtlists (500 … 23500, step 500) into a smallest-bulk-per-lemma map (the lists are supersets, so a word's membership is fully described by the smallest bulk it appears in).flagsFor(word)returns the 47 columns; a word in the top-smallestlist is flagged forsmallestand every larger bucket. Matching is lowercased and accent-folded (tonos + final sigmaς → σ) so headword accentuation differences don't cause misses. No Unicode package needed — Greek is all BMP.BilingualSeed.rowsForLinetakes an optionalHncLemmaBulksand spreads the flags into each row, matched on the Greekexpression(the headword forel/el-de). Non-Greek/unlisted words match nothing → all false.seed_bilingualgains--hnc-bulk-dir <dir>(mirror of--jlpt-dir): loads the lists, logs the lemma count, and reports how many seeded rows matched a bulk (so a bad path / low match-rate is visible).--hnc-bulk-dirupdates the flags in place (upsert merges on(id, language)); no new rows.Verification
dart analyzeclean;dart testgreen (newhnc_lemma_bulks_test.dart: nested membership → correct flags, boundary buckets, absent → all false, case/accent/final-sigma folding, and the seeder join).bulk_lists/(23 432 lemmas loaded):κάνω(top-500) → all 47 flags true;χτύπημα→ smallest bulk 1500;ουρανοξύστης→ smallest bulk 7500; a Germande-elheadword matched nothing. Match-count log correct.Follow-ups (not in this PR)
add_dictionary_vocabularyRPCSELECTse.lemma, a column no checked-in migration defines (selected but unused in the loop) — latent inconsistency, unrelated to flag population.wiktionary_5kis an orphaned column (added + indexed, referenced by neither RPC nor app).