fix: _MIN_WORD_CONF als Modul-Konstante statt lokale Variable
Some checks failed
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-school (push) Successful in 29s
CI / test-go-edu-search (push) Successful in 29s
CI / test-python-klausur (push) Failing after 2m12s
CI / test-python-agent-core (push) Successful in 17s
CI / test-nodejs-website (push) Successful in 20s

NameError in build_cell_grid_v2 weil _MIN_WORD_CONF nur in
_ocr_cell_crop und build_cell_grid lokal definiert war.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Benjamin Admin
2026-03-09 15:12:02 +01:00
parent 7005b18561
commit 60c4138660

View File

@@ -39,6 +39,8 @@ try:
except ImportError:
Image = None # type: ignore[assignment,misc]
# Minimum OCR word confidence to keep (used across multiple functions)
_MIN_WORD_CONF = 30
# ---------------------------------------------------------------------------
@@ -186,7 +188,6 @@ def _ocr_cell_crop(
words = []
# Filter low-confidence words
_MIN_WORD_CONF = 30
if words:
words = [w for w in words if w.get('conf', 0) >= _MIN_WORD_CONF]
@@ -652,7 +653,6 @@ def _ocr_single_cell(
# Filter low-confidence words (OCR noise from images/artifacts).
# Tesseract gives low confidence to misread image edges, borders,
# and other non-text elements.
_MIN_WORD_CONF = 30
if words:
words = [w for w in words if w.get('conf', 0) >= _MIN_WORD_CONF]