Skip to content

Book scan: domain gate for books outside the lexicon's language (mirror of #35, with QA fixes) - #39

Merged
Nathaniel-260 merged 3 commits into
mainfrom
mirror/pr35-domain-gate
Nov 16, 2026
Merged

Nathaniel-260 merged 3 commits into
mainfrom
mirror/pr35-domain-gate

Conversation

@Nathaniel-260

Copy link
Copy Markdown
Owner

Mirror of #35 (fork PR; CodeQL does not run on forks) plus QA fixes: consistent drops of split_alternatives, refusal on a weak/partial lexicon, distinct-word minimum, UI wiring.

🤖 Generated with Claude Code

mynim and others added 3 commits November 15, 2026 21:35
…by default)

Config.book_domain_max (CLI --book-domain-max): before reporting, a book
scan measures the share of the book's words (3+ letters, not abbreviations)
that the lexicon has at most rare_max times apart from the book itself.
Above the threshold (and with at least book_domain_min_words such words)
the rarity-based findings (book_scan.DOMAIN_TYPES: edit1_*,
spelling_variant, missing_space, lost_quotes, real_word) are left out, the
log says so and the result carries a `domain` entry. Final-letter, OCR
profile and extra-space findings stay. Off (0): no `domain` key, output
unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	magiah/cli.py
…nimum

- split_alternatives (and real_word.hints) follow the findings the gate
  leaves out; no is_primary for a gone missing_space finding
- gate refuses (logged, domain.refused small/partial) when the lexicon is
  under book_domain_min_lexicon words or was built partial
- minimum is occurrences AND distinct words (book_domain_min_types, 100)
- document the own-count rule (same as only_this_book / real_word), test it
- UI labels for the new settings, README updates, tests

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@Nathaniel-260
Nathaniel-260 merged commit 36d9153 into main Nov 16, 2026
13 checks passed
@Nathaniel-260
Nathaniel-260 deleted the mirror/pr35-domain-gate branch November 16, 2026 21:01
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.

3 participants