Add models and database persistence for protected phrase extraction

- Introduced dataclasses for phrase candidates, judgments, and matches in `models.py`.
- Implemented database operations for candidate and protected phrases in `store.py`, including loading, saving, and deleting phrases.
- Enhanced text normalization functions in `text_normalization.py` with detailed docstrings.
- Refactored search functionality to utilize new models and methods for detecting protected phrases.
This commit is contained in:
2026-07-09 11:04:59 -04:00
parent e34ed6c597
commit dab18c1385
12 changed files with 2803 additions and 1978 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ import tiktoken
from sqlalchemy import or_, select
from python.ebook_search.epub_parse import parse_epub
from python.ebook_search.protected_phrases.lib import index_chunk_phrase_mentions_for_book
from python.ebook_search.protected_phrases.matching import index_chunk_phrase_mentions_for_book
from python.orm.richie import EbookChapter, EbookChunk, EbookSource
logger = logging.getLogger(__name__)