Skip to content

Make OCR word un-compositing fully optional (#12243)#12251

Merged
niksedk merged 1 commit into
mainfrom
fix/ocr-uncomposite-toggle-12243
Jul 7, 2026
Merged

Make OCR word un-compositing fully optional (#12243)#12251
niksedk merged 1 commit into
mainfrom
fix/ocr-uncomposite-toggle-12243

Conversation

@niksedk

@niksedk niksedk commented Jul 7, 2026

Copy link
Copy Markdown
Member

Fixes #12243.

Problem

In the "Fix common OCR errors" engine, merged words (e.g. wehadwe had) were split by two independent paths, but only one was gated by a setting:

Path Gated?
Curated word-split list ({iso}_WordSplitList.txt) ✅ "OCR: use word split list"
Heuristic UnknownWordGuesser (affix/particle/phonetic splitting) ❌ ran unconditionally

So even after disabling the word-split list, the aggressive heuristic splitter kept splitting words — "making more errors than it fixes," as the reporter put it, with no way to turn it off. This differs from SE 4, where the tool didn't force this behavior.

Changes

  1. Gate the heuristic splitter behind the existing UseWordSplitList() check, so the "OCR: use word split list" checkbox now disables all merged-word splitting. (seconv keeps UseWordSplitList => true, so CLI behavior is unchanged.)
  2. Stop hard-coding guess-unknown-words on in the Fix-common-OCR-errors tool — it now honors DoTryToGuessUnknownWords (matching the OCR window and SE 4).
  3. Expose that preference as a new "OCR: try to guess unknown words" checkbox in the Tools section of Settings, alongside "OCR: use word split list" (SE 4 had it there too).

Defaults are unchanged (both settings default on), so existing behavior is preserved for users who want it.

🤖 Generated with Claude Code

The "Fix common OCR errors" engine split merged words (e.g. "wehad" ->
"we had") via two paths, but only one was gated by a setting:

- The curated word-split list obeyed "OCR: use word split list".
- The heuristic UnknownWordGuesser (affix/particle/phonetic splitting)
  ran unconditionally, so turning the setting off still left words being
  split - over-correcting more than it fixed.

Gate the heuristic splitter behind the same UseWordSplitList toggle so one
checkbox disables all un-compositing. Also stop the Fix-common-OCR-errors
tool from forcing guess-unknown-words on; it now honors the user's
DoTryToGuessUnknownWords preference (as the OCR window and SE 4 did), and
expose that preference as a checkbox in the Tools settings section.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@niksedk niksedk merged commit d176d0f into main Jul 7, 2026
1 of 3 checks passed
@niksedk niksedk deleted the fix/ocr-uncomposite-toggle-12243 branch July 7, 2026 20:02
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.

un-composite words are part of "Fix common OCR errors"

1 participant