From 5c935eec23991c2fb49bbe31bac5b2c9db0ce2d9 Mon Sep 17 00:00:00 2001 From: Benjamin Admin Date: Fri, 20 Mar 2026 08:15:51 +0100 Subject: [PATCH] Refine garbled IPA filter: skip only pure-ASCII garbled text, not text with real IPA MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "Theme [θˈiːm]" contains real IPA symbols (θ, ˈ) and should NOT be filtered. Only filter text that has garbled IPA markers (:, ') but no real Unicode IPA chars. Co-Authored-By: Claude Opus 4.6 --- klausur-service/backend/grid_editor_api.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/klausur-service/backend/grid_editor_api.py b/klausur-service/backend/grid_editor_api.py index 5c08be7..0c20a5a 100644 --- a/klausur-service/backend/grid_editor_api.py +++ b/klausur-service/backend/grid_editor_api.py @@ -737,7 +737,9 @@ def _detect_heading_rows_by_single_cell( if not text or text.startswith("["): continue # Skip garbled IPA without brackets (e.g. "ska:f – ska:vz") - if _text_has_garbled_ipa(text): + # but NOT text with real IPA symbols (e.g. "Theme [θˈiːm]") + _REAL_IPA_CHARS = set("ˈˌəɪɛɒʊʌæɑɔʃʒθðŋ") + if _text_has_garbled_ipa(text) and not any(c in _REAL_IPA_CHARS for c in text): continue heading_row_indices.append(ri)