Repository navigation
Conversation
"אמר רבי" now matches "אמר, רבי" / "אמר: רבי", and punctuation typed in
the query no longer blocks a match. The text is scanned through a new
stripForFindWithMap that keeps an index map, so highlights still land on
the original offsets; nikud/te'amim insensitivity is unchanged.
- Any run of punctuation and/or whitespace reads as one space; leading and
trailing runs are dropped, so a highlight never starts or ends on one.
- Maqaf (U+05BE) is a word break in both text and query (a query typed
with a maqaf used to never match).
- Quote marks between two letters (" ' ׳ ״ and curly/prime look-alikes)
are dropped instead, so רשי, רש"י and רש״י all match one another.
Quotes opening/closing a quoted word stay word breaks.
- A punctuation-only query normalizes to "" and finds nothing.
- The highlight now also covers the points of the last matched letter.
Signed-off-by: Chagai Yisroel Wild <wildhagai@puzzlesoft.co.il>
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.
What
Find-in-book now ignores punctuation.
אמר רביmatchesאמר, רביandאמר: רבי, and punctuation typed in the query (אמר, רבי!) no longer blocks a match. The text is scanned through a newstripForFindWithMap, which keeps a map from stripped to original index, so highlights land on the right characters. Niqqud/te'amim insensitivity and final-letter folding are unchanged.normalizeQueryForHebrewnow normalizes the query exactly the way the text is normalized.Edge-case decisions
שלום,עולם(no space after the comma) still matchesשלום עולם. Punctuation means ASCII non-alphanumerics plus Unicode category P* (sof pasuq ׃, paseq ׀, dashes, curly quotes, …)."שלום"andאור׃search for the bare word, and a highlight never starts or ends on punctuation.""and finds nothing.כל־הארץandכל הארץmatch each other. Before this, a query typed with a maqaf could never match.",',׳,״, curly quotes and primes) is dropped rather than turned into a space. Soרשי,רש"י,רש״יandרש''יall match each other, andס'/ס׳matchס. A quote that opens or closes a quoted word (ואמר "שלום") is still a word break.אמר"שלום") joins them into one word. This is rare in real texts.Tests
New cases in
HebrewSearchTest(index mapping, commas, punctuation only in the query, acronyms in both directions, geresh, maqaf, sof pasuq, pointed text, highlight bounds) and inBookFindMatchesTest(counting matches and query narrowing regardless of punctuation).HebrewSearchTest44/44,BookFindMatchesTest8/8,TocSearchTest9/9ktlintCheckclean🤖 Generated with Claude Code