Preserve grammar annotations (pl), (no pl) and skip articles in IPA
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 25s
CI / test-go-edu-search (push) Successful in 26s
CI / test-nodejs-website (push) Has been cancelled
CI / test-python-agent-core (push) Has been cancelled
CI / test-python-klausur (push) Has been cancelled
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 25s
CI / test-go-edu-search (push) Successful in 26s
CI / test-nodejs-website (push) Has been cancelled
CI / test-python-agent-core (push) Has been cancelled
CI / test-python-klausur (push) Has been cancelled
Two fixes: 1. Add pl, sg, no, also, ae, be etc. to _GRAMMAR_BRACKET_WORDS so annotations like (pl) and (no pl) are not replaced with IPA. 2. Skip articles (the, a, an) in fix_ipa_continuation_cell — they never get IPA in vocabulary books. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -485,13 +485,14 @@ class TestGarbledIpaDetection:
|
||||
assert _text_has_garbled_ipa("equipment") is False
|
||||
|
||||
def test_fix_continuation_united_kingdom(self):
|
||||
"""IPA continuation for 'the United Kingdom' → proper IPA."""
|
||||
"""IPA continuation for 'the United Kingdom' → IPA without 'the'."""
|
||||
fixed = fix_ipa_continuation_cell(
|
||||
"[n, nn]", "the United Kingdom", pronunciation="british",
|
||||
)
|
||||
# Should contain proper IPA, not the garbled text
|
||||
assert fixed != "[n, nn]"
|
||||
assert "kˈɪŋdəm" in fixed # Kingdom IPA
|
||||
assert "ðə" not in fixed # "the" must NOT get IPA
|
||||
|
||||
def test_fix_continuation_equipment(self):
|
||||
"""IPA continuation for 'equipment' → proper IPA."""
|
||||
|
||||
Reference in New Issue
Block a user