From f5328d37d58fd4d1f7f87bded90f1e2aa6334453 Mon Sep 17 00:00:00 2001 From: Kwanghee Choi Date: Thu, 23 Apr 2026 22:57:31 -0500 Subject: [PATCH 1/4] Fix cd such that it doesn't run cd on forked repos --- .github/workflows/cd.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 168aae98..3a83b833 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -15,6 +15,7 @@ concurrency: jobs: release: + if: github.event.repository.fork == false environment: name: pypi url: https://pypi.org/project/epitran/ From 2cfd6b89df9de4f1990643f4f00c9adac3f4ae97 Mon Sep 17 00:00:00 2001 From: Kwanghee Choi Date: Thu, 23 Apr 2026 22:57:58 -0500 Subject: [PATCH 2/4] Drop danish support --- README.md | 1 - epitran/data/map/dan-Latn.csv | 30 ------------ epitran/data/post/dan-Latn.txt | 55 --------------------- epitran/data/pre/dan-Latn.txt | 88 ---------------------------------- epitran/test/test_danish.py | 58 ---------------------- 5 files changed, 232 deletions(-) delete mode 100644 epitran/data/map/dan-Latn.csv delete mode 100644 epitran/data/post/dan-Latn.txt delete mode 100644 epitran/data/pre/dan-Latn.txt delete mode 100644 epitran/test/test_danish.py diff --git a/README.md b/README.md index 260aaf71..e737a5d5 100644 --- a/README.md +++ b/README.md @@ -217,7 +217,6 @@ A few notes are in order regarding this data structure: | cmn-Hant | Mandarin (Traditional)\*| | cmn-Latn | Mandarin (Pinyin)\* | | csb-Latn | Kashubian | -| dan-Latn | Danish | | cym-Latn | Welsh (northern) | | deu-Latn | German | | deu-Latn-np | German† | diff --git a/epitran/data/map/dan-Latn.csv b/epitran/data/map/dan-Latn.csv deleted file mode 100644 index 355ef486..00000000 --- a/epitran/data/map/dan-Latn.csv +++ /dev/null @@ -1,30 +0,0 @@ -Orth,Phon -a,a -b,b -c,k -d,d -e,ə -f,f -g,g -h,h -i,i -j,j -k,k -l,l -m,m -n,n -o,o -p,p -q,k -r,ʁ -s,s -t,t -u,u -v,v -w,v -x,ks -y,y -z,s -æ,ɛ -ø,ø -å,ɔ \ No newline at end of file diff --git a/epitran/data/post/dan-Latn.txt b/epitran/data/post/dan-Latn.txt deleted file mode 100644 index baf9070e..00000000 --- a/epitran/data/post/dan-Latn.txt +++ /dev/null @@ -1,55 +0,0 @@ -::vowel:: = a|e|i|o|u|y|æ|ø|å|ɑ|ɛ|ɪ|ɔ|ʊ|ʏ|œ|ɒ|aɪ|aʊ|ɔɪ|eɪ|oʊ|uː|oː|ɑː|ɛː|ɪː|ɔː|ʊː|ʏː|œː|ɒː|ɐ|ø|ɛɐ̯|iɐ̯|ɔɐ̯|ʊɐ̯|œɐ̯|yɐ̯ -::consonant:: = b|c|d|f|g|h|j|k|l|m|n|p|q|r|s|t|v|w|x|z|ð|ʁ|ɕ -::diphthong:: = aw|aj|ɔj - -% Glottal Stop (stød) - simplified -% Add stød after long vowels in certain contexts -% This is very basic, real stød placement is complex -(aː|eɪ|iː|oʊ|uː|œː|oː|uː|yː|ɔː) -> \1ˈ / _(n|d|g|l|r|v)# - - -% Clean up diphthongs -aw -> aʊ / _ -aj -> aɪ / _ -ɔj -> ɔɪ / _ - -% The Danish schwa sound, often represented by 'e' at the end of words, -% is frequently realized as a near-open central vowel. -% This rule approximates that sound. -ə -> ɐ / _ - - -% Simplify vowel symbols -a -> ɑ / _ -ɛ -> ɛ / _ -ɪ -> ɪ / _ -ɔ -> ɔ / _ -ʊ -> ʊ / _ -ʏ -> ʏ / _ -œ -> œ / _ -ɒ -> ɒ / _ -aɪ -> aɪ / _ -aʊ -> aʊ / _ -ɔɪ -> ɔɪ / _ -eɪ -> eɪ / _ -oʊ -> oʊ / _ -uː -> uː / _ -oː -> oː / _ -ɑ -> ɑ / _ -ɛː -> ɛː / _ -ɪː -> ɪː / _ -ɔː -> ɔː / _ -ʊː -> ʊː / _ -ʏ -> ʏ / _ -œː -> œː / _ -ɒ -> ɒ / _ -ð -> ð / _ -ʁ -> ʁ / _ -ɕ -> ɕ / _ -ɐ -> ɐ / _ -ɛɐ̯ -> ɛɐ̯ / _ -iɐ̯ -> iɐ̯ / _ -ɔɐ̯ -> ɔɐ̯ / _ -ʊɐ̯ -> ʊɐ̯ / _ -œɐ̯ -> œɐ̯ / _ -yɐ̯ -> yɐ̯ / _ diff --git a/epitran/data/pre/dan-Latn.txt b/epitran/data/pre/dan-Latn.txt deleted file mode 100644 index 5f50b7de..00000000 --- a/epitran/data/pre/dan-Latn.txt +++ /dev/null @@ -1,88 +0,0 @@ -::vowels:: = a|e|i|o|u|y|æ|ø|å -::consonants:: = b|c|d|f|g|h|j|k|l|m|n|p|q|r|s|t|v|w|x|z - - -% Vowel Length and Contextual Rules -a -> aː / _[^::consonant::][^::consonant::] -a -> a / _::consonant::::consonant:: -a -> aː / _# -a -> ɑ / _(k|m|p|r|u|ng) -a -> ɛ / _(d|l|n|s|t) - -e -> eː / _[^::consonant::][^::consonant::] -e -> ɛ / _::consonant::::consonant:: -e -> eː / _# -e -> 0 / _(n|m)# - -i -> iː / _[^::consonant::][^::consonant::] -i -> ɪ / _(ig|ik|it|lig|tig|i)# -i -> e / _ - -o -> oː / _[^::consonant::][^::consonant::] -o -> ɔ / _::consonant::::consonant:: -o -> oː / _# - -u -> uː / _[^::consonant::][^::consonant::] -u -> o / _::consonant::::consonant:: - -æ -> ɛː / _[^::consonant::][^::consonant::] -æ -> ɛ / _::consonant::::consonant:: -æ -> eɪ / _r - -ø -> øː / _[^::consonant::][^::consonant::] -ø -> œ / _::consonant::::consonant:: -ø -> øː / _# -ø -> ɔj / _(j|g) - -å -> ɔː / _[^::consonant::][^::consonant::] -å -> ʌ / _::consonant::::consonant:: -å -> oː / _r - -y -> yː / _[^::consonant::][^::consonant::] -y -> ø / _::consonant::::consonant:: - -% Consonant Contextual Rules -c -> s / _(e|i|y|æ|ø) -d -> ð / _# -g -> j / _(e|i|y|æ|ø) -g -> v / _(o|å) -g -> 0 / _# -h -> 0 / _::consonant:: -n -> ŋ / _g -p -> b / _[^#] -t -> d / _[^#] -r -> 0 / _::vowel:: -v -> w / (::consonant::)_ -x -> s / _(c|t|s) - -% Special letter combinations -hv -> v / #_ -hj -> j / #_ -aj -> aj -ej -> aj -eg -> aj -af -> aw / #_ -ag -> ej / _::vowel:: -ag -> ej / _# -ag -> aw / _::consonant:: -av -> ɛv / _::vowel:: -av -> ɛw / _::vowel:: -av -> aw / _::consonant:: -av -> aw / _# -er -> o / _# - - -% Loanword rules (examples) -j -> ɕ / jazz|jeans|jury - - -% "R" after Vowels -ar -> aː / _ -er -> ɛɐ̯ / _ -ir -> iɐ̯ / _ -or -> ɔɐ̯ / _ -ur -> ʊɐ̯ / _ -ær -> ɛɐ̯ / _ -ør -> œɐ̯ / _ -år -> ɔɐ̯ / _ -yr -> yɐ̯ / _ diff --git a/epitran/test/test_danish.py b/epitran/test/test_danish.py deleted file mode 100644 index f24dfe37..00000000 --- a/epitran/test/test_danish.py +++ /dev/null @@ -1,58 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -import unittest -import epitran - - -class TestDanish(unittest.TestCase): - def setUp(self): - self.epi = epitran.Epitran('dan-Latn') - - def test_1(self): - res = self.epi.transliterate("jazz") - self.assertEqual(res, "ɕass") - - def test_2(self): - res = self.epi.transliterate("lærer") - self.assertEqual(res, "lɛɐ̯ɐʁ") - - def test_3(self): - res = self.epi.transliterate("får") - self.assertEqual(res, "fɔɐ̯") - - def test_4(self): - res = self.epi.transliterate("tyve") - self.assertEqual(res, "tyvɐ") - - def test_5(self): - res = self.epi.transliterate("synge") - self.assertEqual(res, "søŋgɐ") - - def test_6(self): - res = self.epi.transliterate("dårlig") - self.assertEqual(res, "dɔɐ̯lig") - - def test_7(self): - res = self.epi.transliterate("bånd") - self.assertEqual(res, "bʌnd") - - def test_8(self): - res = self.epi.transliterate("nat") - self.assertEqual(res, "nɛt") - - def test_9(self): - res = self.epi.transliterate("aften") - self.assertEqual(res, "ɛftɛn") - - def test_10(self): - res = self.epi.transliterate("hej") - self.assertEqual(res, "haɪ") - - def test_11(self): - res = self.epi.transliterate("sejle") - self.assertEqual(res, "saɪlɐ") - - -if __name__ == "__main__": - unittest.main() From 5a7ea23b75170b31f43f687cf40950cfd44cef64 Mon Sep 17 00:00:00 2001 From: Kwanghee Choi Date: Thu, 23 Apr 2026 22:58:16 -0500 Subject: [PATCH 3/4] Fix typos in test suite --- epitran/test/test_occitan.py | 4 ++-- epitran/test/test_pashto.py | 32 ++++++++++++++++++-------------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/epitran/test/test_occitan.py b/epitran/test/test_occitan.py index e984d954..bb9a8e8f 100644 --- a/epitran/test/test_occitan.py +++ b/epitran/test/test_occitan.py @@ -5,8 +5,8 @@ import epitran class TestOccitan(unittest.TestCase): - def setUp(self): - self.epi = epitran.Epitran("oci-Latn") + def setUp(self): + self.epi = epitran.Epitran("oci-Latn") def test_abadia(self): # test intervocalic g, word-final r diff --git a/epitran/test/test_pashto.py b/epitran/test/test_pashto.py index f1becc4c..d13910b9 100644 --- a/epitran/test/test_pashto.py +++ b/epitran/test/test_pashto.py @@ -1,18 +1,22 @@ import epitran +import unittest -epi = epitran.Epitran('pbu-Arab') +class TestPashto(unittest.TestCase): + def setUp(self): + self.epi = epitran.Epitran("pbu-Arab") -def t(x, y): - assert epi.transliterate(x) == y + def t(self, x, y): + tr = self.epi.transliterate(x) + self.assertEqual(tr, y) -def test_core(): - t('پښتو', 'paxto') # PBU merger ښ→x, no implicit vowels - t('کور', 'kor') # و→o in C_و_C by postrule (Northern Pashto) - t('ګل', 'ɡul') # no implicit vowels between ګ and ل - t('څنګه', 'saŋɡa') # څ→s; n→ŋ/_{ɡ}, final ه→a (with nasal assimilation) - t('ژوند', 'd͡ʒwand') # ژ→d͡ʒ (PBU), و→w between consonants - t('مینه', 'mi:na') # ی→i; final ه→a (or ə if spelledۀ) - t('ونه', 'wana') # و onset → w, no implicit vowels - t('او', 'ɑw') # diphthong (correct transliteration) - t('ستړی', 'staɽai') # ړۍ→ɽ + final ی as i, no implicit vowels - t('سړي', 'saɽi:') # ړۍ→ɽ + final ی as i, no implicit vowels + def test_core(self): + self.t('پښتو', 'paxto') # PBU merger ښ→x, no implicit vowels + self.t('کور', 'kor') # و→o in C_و_C by postrule (Northern Pashto) + self.t('ګل', 'ɡul') # no implicit vowels between ګ and ل + self.t('څنګه', 'saŋɡa') # څ→s; n→ŋ/_{ɡ}, final ه→a (with nasal assimilation) + self.t('ژوند', 'd͡ʒwand') # ژ→d͡ʒ (PBU), و→w between consonants + self.t('مینه', 'mi:na') # ی→i; final ه→a (or ə if spelledۀ) + self.t('ونه', 'wana') # و onset → w, no implicit vowels + self.t('او', 'ɑw') # diphthong (correct transliteration) + self.t('ستړی', 'staɽai') # ړۍ→ɽ + final ی as i, no implicit vowels + self.t('سړي', 'saɽi:') # ړۍ→ɽ + final ی as i, no implicit vowels From 8c062544c79407c2298b83519a341d39f41a5b66 Mon Sep 17 00:00:00 2001 From: Kwanghee Choi Date: Thu, 23 Apr 2026 23:08:08 -0500 Subject: [PATCH 4/4] fix PR templates --- .github/pull_request_template.md | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index ec00ad1f..e62c791c 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,25 +1,30 @@ -* **What kind of change does this PR introduce?** (Language addition, bug fix, feature, docs update, ...) +### What kind of change does this PR introduce? + - -* **Checklist** + +### Checklist - [] Have you added adequate tests on epitran/test? - [] Have you updated the language list in README.md? - [] Does it follow the - format? - [] Have you used IPA ɡ, not latin small letter g? -* **Sources of information for the test samples** (I'm a native speaker, books, online resources, ...) +### Sources of information for the test samples + -* **Sources of information for the rules** (I'm a native speaker, books, online resources, ...) +### Sources of information for the rules + - -* **What is the current behavior?** (You can also link to an open issue here) + +### What is the current behavior? + -* **What is the new behavior (if this is a feature change)?** +### What is the new behavior (if this is a feature change)? -* **Does this PR introduce a breaking change?** (What changes might users need to make in their application due to this PR?) +### Does this PR introduce a breaking change? +