Fix IPA marker split: walk back max 3 chars for onset cluster
The walk-back was going 4 chars, eating the last letter of the headword: "schoolbag" → "schoolba". Limiting to 3 gives correct split: "schoolbag" + "[sku:lbæg]". Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1073,7 +1073,7 @@ def _insert_missing_ipa(text: str, pronunciation: str = 'british') -> str:
|
|||||||
if first_marker >= 3:
|
if first_marker >= 3:
|
||||||
split = first_marker
|
split = first_marker
|
||||||
while (split > 0
|
while (split > 0
|
||||||
and split > first_marker - 4
|
and split > first_marker - 3
|
||||||
and w[split - 1].isalpha()
|
and w[split - 1].isalpha()
|
||||||
and w[split - 1].islower()):
|
and w[split - 1].islower()):
|
||||||
split -= 1
|
split -= 1
|
||||||
|
|||||||
Reference in New Issue
Block a user