diff --git a/klausur-service/backend/cv_syllable_detect.py b/klausur-service/backend/cv_syllable_detect.py index cc43cf9..c1e1acc 100644 --- a/klausur-service/backend/cv_syllable_detect.py +++ b/klausur-service/backend/cv_syllable_detect.py @@ -150,8 +150,11 @@ def _syllabify_text(text: str, hyph_de, hyph_en) -> str: if not text: return text - # Skip cells that contain IPA transcription characters - if _IPA_RE.search(text): + # Skip cells that contain IPA transcription characters outside brackets. + # Bracket content like [bɪltʃøn] is programmatically inserted and should + # not block syllabification of the surrounding text. + text_no_brackets = re.sub(r'\[[^\]]*\]', '', text) + if _IPA_RE.search(text_no_brackets): return text # Phase 1: strip existing pipe dividers for clean normalization