From 41dac78274864772aff3552587972cbfe6714041 Mon Sep 17 00:00:00 2001 From: Ronald Tse Date: Wed, 7 Oct 2026 15:51:33 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20vocalized=20gutturals=20carry=20glottal?= =?UTF-8?q?=20stop=20=E2=80=94=20TTS/phonikud=20convention?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/interscript/ml/nikud_ipa.py | 4 +++- tests/test_nikud_ipa.py | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/interscript/ml/nikud_ipa.py b/src/interscript/ml/nikud_ipa.py index 4e23f71..979b1c1 100644 --- a/src/interscript/ml/nikud_ipa.py +++ b/src/interscript/ml/nikud_ipa.py @@ -81,7 +81,9 @@ def nikud_to_ipa(text: str) -> str: continue if letter in ("א", "ע"): - out.append(vowels) # silent guttural, vowel carries + # gutturals carry ʔ when vocalized (Israeli/TTS convention), + # fully silent when bare + out.append("ʔ" + vowels if vowels else "") continue if letter == "ה" and last: diff --git a/tests/test_nikud_ipa.py b/tests/test_nikud_ipa.py index 4955007..623faec 100644 --- a/tests/test_nikud_ipa.py +++ b/tests/test_nikud_ipa.py @@ -44,8 +44,8 @@ def test_yod_after_vowel_is_silent_lengthener(self): assert nikud_to_ipa("רִי") == "ʁi" def test_gutturals_silent_with_vowel(self): - assert nikud_to_ipa("אָב") == "av" - assert nikud_to_ipa("עִיר") == "iʁ" + assert nikud_to_ipa("אָב") == "ʔav" + assert nikud_to_ipa("עִיר") == "ʔiʁ" def test_final_heh_silent(self): assert nikud_to_ipa("סֻכָּה") == "suka" @@ -64,7 +64,7 @@ def test_core_vowels(self): def test_hataf(self): assert nikud_to_ipa("חֲנֻכָּה") == "xanuka" - assert nikud_to_ipa("אֱמֶת") == "emet" + assert nikud_to_ipa("אֱמֶת") == "ʔemet" def test_qamats_qatan_via_lexicon(self): # כָּל is the canonical qamats-qatan word: /kol/ @@ -93,5 +93,5 @@ def test_every_real_cluster_has_rule_or_override(self): class TestPassThrough: def test_spaces_and_latin_survive(self): - assert nikud_to_ipa("שָׁלוֹם עֲלֵיכֶם") == "ʃalom alexem" + assert nikud_to_ipa("שָׁלוֹם עֲלֵיכֶם") == "ʃalom ʔalexem" assert nikud_to_ipa("abc") == "abc"