Repository navigation
fix(sefariasqlite): translate English section names leaking into Hebrew headings - #96
Merged
Merged
Conversation
…ew headings When a schema leaves a heSectionNames entry blank, the importer falls back to the English sectionNames through mapSectionNameToHebrew, which had no mapping for many names: the Epistle of Rav Sherira Gaon showed "Question א" (kdroidFilter/Zayit#501), and Comment, DH, Sheilta, Gate, Ot... leaked the same way across the corpus. - Map the remaining names found in the Sefaria schemas, following Sefaria's Term dictionary and the Hebrew names it pairs them with in other books. - Treat "Integer" as an unnamed level and title its headings with the bare number, as Sefaria does in its refs and reader. Signed-off-by: Elie Gambache <elyahou.hadass@gmail.com>
Y-PLONI
added a commit
to Otzaria/SeforimLibrary
that referenced
this pull request
Oct 8, 2026
…ew headings Port of kdroidFilter#96 (upstream 773fcc9) onto our mapSectionNameToHebrew, which already covered part of it (7c0f0ff). - Add the names still leaking from blank heSectionNames: DH, Pararaph, Passuk, Footnote, Tosefta, Midrash, Drush, Remez, Inyan, Mitzvah, Piyyut, Hadran, Kovetz, Gate/Sha'ar, Essay, Statement, Letter, Chamber, Window, Book. - Treat "Integer" as an unnamed level: its headings are the bare number. - Normalize input (lowercase, trim quotes/spaces) as upstream does. - Keep our values where they differ (Word, Treatise, Maayan, Manuscript, Vav); generic English words are matched exactly, not as substrings.
Y-PLONI
added a commit
to Otzaria/SeforimLibrary
that referenced
this pull request
Oct 8, 2026
…ew headings Port of kdroidFilter#96 (upstream 773fcc9) onto our mapSectionNameToHebrew, which already covered part of it (7c0f0ff). - Add the names still leaking from blank heSectionNames: DH, Pararaph, Passuk, Footnote, Tosefta, Midrash, Drush, Remez, Inyan, Mitzvah, Piyyut, Hadran, Kovetz, Gate/Sha'ar, Essay, Statement, Letter, Chamber, Window, Book. - Treat "Integer" as an unnamed level: its headings are the bare number. - Normalize input (lowercase, trim quotes/spaces) as upstream does. - Keep our values where they differ (Word, Treatise, Maayan, Manuscript, Vav); generic English words are matched exactly, not as substrings.
Y-PLONI
added a commit
to Otzaria/SeforimLibrary
that referenced
this pull request
Oct 8, 2026
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.
Fixes kdroidFilter/Zayit#501. Headings in the Epistle of Rav Sherira Gaon showed the English "Question" instead of a Hebrew label.
Cause
Sefaria's schema for this book has
heSectionNames: ["", "פסקה"]. When a Hebrew name is blank, the importer translates the English name withmapSectionNameToHebrew, which had no entry for "Question" and returned the English word. A scan of every Sefaria schema found about 40 other names leaking the same way: Comment (3,939 cases), DH, Sheilta, Gate, Ot, Word…Changes
/api/terms) and the Hebrew names Sefaria gives the same English name in books whereheSectionNamesis filled in, for example Comment → פירוש, Letter → אות, Essay → מאמר, Chamber → חדר. When there is no Term, the label is based on the book's structure: Question → שאלה, Principle → עיקר (Sefer HaBachur), Word → ערך (Machberet Menachem).ot,dh) must match exactly so they can't catch longer words. Quotes around names ('Comment') are removed before matching.א׳:א׳:א׳).mapSectionNameToHebrewnow returnsnullfor it, and the reader titles the heading with the bare number instead of "Integer א". A blank label still produces no heading, as before.Tests
New
SefariaSectionNameMappingTest: checks the mappings, that short names don't match inside longer words, and an end-to-end Chapter/Halakhah/Integer/Integer schema. All:sefariasqlite:jvmTesttests pass. The database was not regenerated as part of this PR.🤖 Generated with Claude Code