Fix IPA continuation: only process fully-bracketed cells, keep phrasal verb particles
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 26s
CI / test-go-edu-search (push) Successful in 26s
CI / test-python-klausur (push) Failing after 1m53s
CI / test-python-agent-core (push) Successful in 15s
CI / test-nodejs-website (push) Successful in 16s

Two fixes:
1. Step 5d now only treats cells as continuation when text is entirely
   inside brackets (e.g. "[n, nn]"). Cells with headwords outside brackets
   (e.g. "employee [im'ploi:]") are no longer overwritten.
2. fix_ipa_continuation_cell no longer skips grammar words like "down" —
   they are part of the headword in phrasal verbs like "close sth. down".

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Benjamin Admin
2026-03-20 00:43:51 +01:00
parent 5f89913a9a
commit 92a7b85c2d
3 changed files with 32 additions and 5 deletions

View File

@@ -1634,7 +1634,13 @@ async def _build_grid_core(session_id: str, session: dict) -> dict:
ct = cell.get("col_type", "")
if not ct.startswith("column_"):
continue
cell_text = cell.get("text", "")
cell_text = (cell.get("text") or "").strip()
# Only treat as continuation when text is entirely
# inside brackets — e.g. "[n, nn]", "[klaoz 'daun]".
# Text like "employee [im'ploi:]" has a headword
# OUTSIDE brackets and must NOT be overwritten.
if not (cell_text.startswith('[') and cell_text.endswith(']')):
continue
if not _text_has_garbled_ipa(cell_text):
continue
# Already has proper IPA brackets → already fixed