Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/interscript/ml/nikud_ipa.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions tests/test_nikud_ipa.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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/
Expand Down Expand Up @@ -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"
Loading