feat(ocr): German spell-check post-processing to reduce handwriting gibberish #260

Merged
marcel merged 10 commits from feat/issue-254-german-spell-check into main 2026-04-17 17:28:41 +02:00
Showing only changes of commit ec85f228c1 - Show all commits

View File

@@ -107,7 +107,7 @@ def correct_text(text: str) -> str:
continue
correction = _spell.correction(word)
if correction and _spell.word_frequency[correction] > 50:
if correction and _spell.word_frequency[correction] > 50: # strict > avoids non-determinism when candidates tie at the frequency floor
if word[0].isupper() and not correction[0].isupper():
correction = correction.capitalize()
checked.append(leading + correction + CORRECTION_MARKER + trailing)