Fix IPA:Aus — strip all brackets before skipping IPA block
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 49s
CI / test-go-edu-search (push) Successful in 35s
CI / test-python-klausur (push) Failing after 2m53s
CI / test-nodejs-website (push) Has been cancelled
CI / test-python-agent-core (push) Has started running
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 49s
CI / test-go-edu-search (push) Successful in 35s
CI / test-python-klausur (push) Failing after 2m53s
CI / test-nodejs-website (push) Has been cancelled
CI / test-python-agent-core (push) Has started running
When ipa_mode=none, the entire IPA processing block was skipped, including the bracket-stripping logic. Now strips ALL square brackets from content columns BEFORE the skip, so IPA:Aus actually removes all IPA from the display. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -961,6 +961,21 @@ async def _build_grid_core(
|
|||||||
ipa_target_cols: set = set()
|
ipa_target_cols: set = set()
|
||||||
all_content_cols: set = set()
|
all_content_cols: set = set()
|
||||||
skip_ipa = (ipa_mode == "none")
|
skip_ipa = (ipa_mode == "none")
|
||||||
|
|
||||||
|
# When ipa_mode=none, strip ALL square brackets from ALL content columns
|
||||||
|
if skip_ipa:
|
||||||
|
_SQUARE_BRACKET_RE_NONE = re.compile(r'\s*\[[^\]]+\]')
|
||||||
|
for cell in all_cells:
|
||||||
|
ct = cell.get("col_type", "")
|
||||||
|
if not ct.startswith("column_"):
|
||||||
|
continue
|
||||||
|
text = cell.get("text", "")
|
||||||
|
if "[" in text:
|
||||||
|
stripped = _SQUARE_BRACKET_RE_NONE.sub("", text)
|
||||||
|
if stripped != text:
|
||||||
|
cell["text"] = stripped.strip()
|
||||||
|
cell["_ipa_corrected"] = True
|
||||||
|
|
||||||
if not skip_ipa and total_cols >= 3:
|
if not skip_ipa and total_cols >= 3:
|
||||||
# Detect English headword column via IPA signals (brackets or garbled).
|
# Detect English headword column via IPA signals (brackets or garbled).
|
||||||
col_ipa_count: Dict[str, int] = {}
|
col_ipa_count: Dict[str, int] = {}
|
||||||
|
|||||||
Reference in New Issue
Block a user