Repository navigation
Fix token glosses shifted past ketiv/qere, and audit re-imports - #19
Open
wirelessdreamer wants to merge 2 commits into
Open
wirelessdreamer wants to merge 2 commits into
wirelessdreamer wants to merge 2 commits into
Conversation
MACULA numbers each qere word after its ketiv and leaves the ketiv's number empty; OSHB keeps the qere in a note. The importer joined on the OSHB word position, so every token after a ketiv took the enrichment of the word before it (Ps 24:6 Selah read "O Jacob"). 56 verses were hit. Tokens now join MACULA on a qere-aware word number; token ids and refs keep the OSHB position. A ketiv token reads as its qere word(s). The importer now writes an AuditRecord for each existing unit it changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Regenerated with scripts/import_psalms.py on 02ad560. 65 verses get corrected token enrichment (the 56 where glosses were shifted past a ketiv, plus ketiv tokens now read as their qere); the rest of the 2,235 units refresh occurrence indexes and refs that moved with the corrected lemmas. Each changed unit carries one "import" AuditRecord. validate_content.py passes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Summary
In verses with a ketiv/qere, every token after the ketiv carried the gloss of the word before it. In Ps 24:6, for example, Selah was glossed "O Jacob" and the glosses before it were shifted. Codex prompts list these glosses next to each token, so drafts were misled.
Cause.
full_psalm_import_servicejoined OSHB tokens to MACULA by word position. OSHB has the ketiv as a word and keeps the qere in a<note>. MACULA follows WLC numbering: it leaves the ketiv's number empty and gives each qere word its own number. So after a ketiv, the OSHB position was one (or two) behind MACULA. Strong and morph come from OSHB, so they stayed correct while gloss, lemma, transliteration and Greek shifted.Changes
macula_word_numberfor the join.token_idandrefkeep the OSHB position, so token IDs, alignments and the MT source snapshot are unchanged.import_vendored_psalmsnow writes oneAuditRecord(change_type: "import",created_by: "import-psalms") for each existing unit it changes. Before this, re-imports, including the one on daemon restart, wrote no audit trail.python scripts/import_psalms.pyon this branch (second commit).Units changed
2,235 units in total, each with one import audit record.
occurrence_indexand*_occurrence_refs, which moved with the corrected lemmas.Re-importing without the fix produces 0 diffs, so every change here comes from this fix.
65 units with corrected enrichment
ps005.v009.a,ps006.v004.a,ps009.v013.a,ps009.v019.a,ps010.v005.a,ps010.v010.a,ps010.v012.a,ps011.v001.a,ps017.v011.a,ps017.v014.a,ps018.v051.a,ps021.v002.a,ps024.v006.a,ps026.v002.a,ps030.v004.a,ps038.v021.a,ps039.v001.a,ps041.v003.a,ps042.v009.a,ps049.v015.a,ps051.v004.a,ps054.v007.a,ps055.v016.a,ps056.v007.a,ps058.v008.a,ps059.v011.a,ps059.v016.a,ps060.v007.a,ps066.v007.a,ps071.v012.a,ps071.v020.a,ps072.v017.a,ps073.v002.a,ps073.v010.a,ps073.v016.a,ps074.v006.a,ps074.v011.a,ps077.v001.a,ps077.v012.a,ps077.v020.a,ps079.v010.a,ps085.v002.a,ps089.v018.a,ps089.v029.a,ps090.v008.a,ps092.v016.a,ps100.v003.a,ps101.v005.a,ps102.v024.a,ps105.v018.a,ps105.v028.a,ps106.v045.a,ps119.v079.a,ps119.v147.a,ps119.v161.a,ps126.v004.a,ps129.v003.a,ps139.v006.a,ps139.v016.a,ps140.v010.a,ps140.v011.a,ps140.v013.a,ps145.v006.a,ps147.v019.a,ps148.v002.aLayer(s) changed
Only source-token enrichment changes:
display_gloss,gloss_parts,lemma,transliteration,greek,word_senseand occurrence refs. No renderings are touched.Canonical or alternate
No renderings change. Proposed (not canonical) renderings exist in 5:9, 6:4, 26:2, 66:7, 77:1, 77:12 and 77:20. The proposed literal ones (26:2, 77:1, 77:12, 77:20) may have been drafted from the shifted glosses and are worth re-checking. None of the affected units have alignments.
Linked issues
None. Found while drafting a Psalm 24 song setting that must sing Selah at 24:6.
Evidence
Ps.24.6:<w type="x-ketiv">דרש/ו</w><note type="variant">…<rdg type="x-qere"><w>דֹּרְשָׁ֑י/ו</w>. Raw MACULA has refsPSA 24:6!1, !2, !4 … !8and no!3.test_ketiv_reads_as_its_qere_and_later_words_keep_their_own_enrichment(24:6 and 10:10). It fails without the fix.Validation checklist
python scripts/validate_content.py(no errors, before and after regeneration)python scripts/build_indexes.py: not run. Derived and not committed; rebuild after merge so concordance search shows the corrected glosses.python scripts/generate_reports.py --release-id draftpytest tests/unit tests/integration: 722 passed.Reviewer checklist
Not fixed (follow-ups)
source_hebrewdrops ketiv/qere words entirely; 24:6source_hebrewhas no דרשו.lemmatakes the last MACULA component, so suffixed words show the suffix lemma (e.g. הוּא for פָנֶיךָ).🤖 Generated with Claude Code