Skip to content

feat(dh): store the printed dibbur alongside its key (line_dh.dhDisplay) - #24

Open
palmoni5 wants to merge 1 commit into
Otzaria:otzariafrom
palmoni5:feat/line-dh-display
Open

feat(dh): store the printed dibbur alongside its key (line_dh.dhDisplay)#24
palmoni5 wants to merge 1 commit into
Otzaria:otzariafrom
palmoni5:feat/line-dh-display

Conversation

@palmoni5

@palmoni5 palmoni5 commented Sep 2, 2026

Copy link
Copy Markdown
Member

Why

line_dh.dhText is the DhKey form — 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.extract returns Dh(key, display). display is the raw dibbur with whitespace collapsed and the same edge punctuation DhKey trims 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_dh gains dhDisplay TEXT NOT NULL (schema, LineDhQueries.sq, the CLI's CREATE TABLE and insert).
  • Patch contract: the PK is unchanged; with a non-PK column the table becomes updatable, so PatchTables and patch_tables_contract.json say 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's sqlite_master and already carries the new shape.

Tests

  • DhExtractorTest: existing assertions go through a key() 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.
  • Ran :generator-common:jvmTest for the dh and patch packages locally: all green except the two frozen schema-1/3 contract fixtures, which fail on this Windows checkout only because core.autocrlf gives them CRLF — untouched here, unrelated.

Consumer: Otzaria/otzaria#1121 (dibburim as sub-headings in the navigation panel).

🤖 Generated with Claude Code

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>
@palmoni5

palmoni5 commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

ה-job contract אדום כי ה-cmp משווה את ה-fixture מול ענף ה-main של ה-updater. PR מקביל שמעדכן את הצד השני: Otzaria/otzaria_library_updater#9 — למזג יחד.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant