Repository navigation
feat(search): one highlighting logic for results, preview and smart find - #635
Merged
Merged
Conversation
- Results' snippets, their preview pane and the reader's smart find all highlight through SearchEngine.highlightRanges / highlights: whole words for the query (and its inflections), consecutive ones as one span; a found line without them gets the passage closest in meaning. The preview no longer guesses the passage from the snippet's bold, nor matches substrings - Smart find in a book is the hybrid search scoped to the book: the lines with the query's words come first-class, highlighted as words - Meaning-based snippets are refined only for lines without the query's words - seforim-semantic 0.4.1 (book-filtered dense search); SeforimLibrary with the shared highlighter Signed-off-by: Elie Gambache <elyahou.hadass@gmail.com>
The backup on quit ran on the UI thread before the windows closed, up to 10 s of network round trips after a session with changes (every search records the history). It now runs in a shutdown hook: the windows close at once and the process finishes the upload out of sight, within the same limit. QuitBackupTest checks it in a child JVM exiting through System.exit, as the app does. Signed-off-by: Elie Gambache <elyahou.hadass@gmail.com>
Signed-off-by: Elie Gambache <elyahou.hadass@gmail.com>
Owner
Author
|
Added: the smart find (✨) shows each line's passage closest in meaning beside the query's words again (the embedding looked unused). Depends now on kdroidFilter/SeforimLibrary#117 too; the submodule points to its branch. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Depends on kdroidFilter/SeforimLibrary#116 (the submodule points to its branch) and seforim-semantic 0.4.1 (published, SeforimEmbedding#2 merged).
Highlighting
One logic, in the search engine, for the three places a search is highlighted:
SearchEngine.highlightRanges/highlights. It used to take the snippet's bold words and match them as substrings in every line (נבראו half-highlighted for ברא).Rules (see SeforimLibrary#116): whole words; the word itself, prefixed or inflected; never a loose dictionary variant (עם for כל); acronyms with any quotes; consecutive words as one span; the passage closest in meaning only where none of the query's words is.
Quit
Quitting waited up to 10 s for the Drive backup on the UI thread (reproduced: thread dump of a real quit). It now runs in a shutdown hook;
QuitBackupTestchecks it in a child JVM exiting throughSystem.exit. Confirmed fast on a real quit.Validation