feat: harvest meaningful search categories for autocomplete - #3570
Open
EliezerIsrael wants to merge 2 commits into
Open
feat: harvest meaningful search categories for autocomplete#3570EliezerIsrael wants to merge 2 commits into
EliezerIsrael wants to merge 2 commits into
Conversation
Replace AutoCompleter._get_main_categories with _get_search_categories,
which builds the category feed for autocomplete from the TOC tree.
- Keep the base-text browse taxonomy (categories with >= 2 children),
recursing to full depth instead of stopping at two levels.
- At commentary/era/"Other" boundaries ("Commentary", "Rishonim on X",
"Acharonim", "Modern", "Other ... Works", "Targum", "Guides"): drop the
boundary node but harvest the good names one level below it (Rashi,
Ramban, Kessef Mishneh, ...), without descending into their repeated
per-book structure.
This removes the tens of duplicated commentary sub-trees (e.g. a full
"Mishneh Torah" structure repeated under each of its commentators) while
surfacing the commentator/author names that are valuable as search terms.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
📊 Code Quality Score: 7/100
Was this score accurate? 👍 Yes · 👎 No Scored by GitVelocity · How are scores calculated? |
`cats += [...]` inside the nested walk() rebinds `cats` as a local of walk (augmented assignment), causing UnboundLocalError. Use list.append, which mutates the enclosing list in place. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Replace AutoCompleter._get_main_categories with _get_search_categories, which builds the category feed for autocomplete from the TOC tree.
This removes the tens of duplicated commentary sub-trees (e.g. a full "Mishneh Torah" structure repeated under each of its commentators) while surfacing the commentator/author names that are valuable as search terms.
Description
A brief description of the PR
Code Changes
The following changes were made to the files below
Notes
Any additional notes go here