feat(dh): store the printed dibbur alongside its key (line_dh.dhDisplay) - #24
Open
palmoni5 wants to merge 1 commit into
Open
feat(dh): store the printed dibbur alongside its key (line_dh.dhDisplay)#24palmoni5 wants to merge 1 commit into
palmoni5 wants to merge 1 commit into
Conversation
dhText is the DhKey form — points, quote marks and edge punctuation stripped — which is right for prefix matching but unfit to show: the Otzaria client wants to list dibburim as sub-headings under the TOC, and "בראשית" is not what the page prints for "בְּרֵאשִׁית." So the extractor now returns both forms (DhExtractor.Dh) and the index stores the printed one in a new NOT NULL column, dhDisplay: tags never occur inside an accepted dibbur, whitespace is collapsed, and the same edge punctuation DhKey trims is trimmed so key and display end at the same place. Points and quote marks stay. The PK is unchanged; the column rides along as the table's first non-PK column, so line_dh becomes updatable in the patch contract (fixture updated). Schema 4 has not shipped — the latest release is the schema-3 v23→v24 delta — so no schema bump: the promotion migration is inferred from the new DB's sqlite_master and already carries the new shape. Tests: DhExtractorTest goes through a key() helper for the existing assertions and adds display cases; BuildLineDhIndexCliTest asserts the stored pair. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Member
Author
|
ה-job |
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.
Why
line_dh.dhTextis theDhKeyform — points, quote marks and edge punctuation stripped. That is what prefix matching needs, but it is unfit to display: the Otzaria client is about to list dibburim as sub-headings under the TOC, andבראשיתis not what the page prints forבְּרֵאשִׁית..What
DhExtractor.extractreturnsDh(key, display).displayis the raw dibbur with whitespace collapsed and the same edge punctuationDhKeytrims removed, so key and display end at the same place; points and quote marks stay. Tags never occur inside an accepted dibbur (the bold regex forbids them; the dash path rejects<).line_dhgainsdhDisplay TEXT NOT NULL(schema,LineDhQueries.sq, the CLI'sCREATE TABLEand insert).updatable, soPatchTablesandpatch_tables_contract.jsonsay so. Schema 4 has not shipped (latest release is the schema-3 v23→v24 delta), so no schema bump — the promotion migration is inferred from the new DB'ssqlite_masterand already carries the new shape.Tests
DhExtractorTest: existing assertions go through akey()helper; two new cases cover the display form (points/quotes kept, closing period dropped; inner whitespace collapsed).BuildLineDhIndexCliTest: the bold-format case asserts the stored(dhText, dhDisplay)pair; fixtures updated for the 4th column.:generator-common:jvmTestfor thedhandpatchpackages locally: all green except the two frozen schema-1/3 contract fixtures, which fail on this Windows checkout only becausecore.autocrlfgives them CRLF — untouched here, unrelated.Consumer: Otzaria/otzaria#1121 (dibburim as sub-headings in the navigation panel).
🤖 Generated with Claude Code