phoonnx 0.2.7a1__tar.gz → 0.3.0a1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/PKG-INFO +1 -1
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/config.py +4 -1
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/phonemizers/__init__.py +2 -0
- phoonnx-0.3.0a1/phoonnx/phonemizers/pt.py +57 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/version.py +2 -2
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx.egg-info/PKG-INFO +1 -1
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx.egg-info/SOURCES.txt +2 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx.egg-info/requires.txt +1 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/README.md +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/__init__.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/locale/ca/phonetic_spellings.txt +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/locale/en/phonetic_spellings.txt +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/locale/gl/phonetic_spellings.txt +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/locale/pt/phonetic_spellings.txt +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/phoneme_ids.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/phonemizers/ar.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/phonemizers/base.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/phonemizers/en.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/phonemizers/fa.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/phonemizers/gl.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/phonemizers/he.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/phonemizers/ja.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/phonemizers/ko.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/phonemizers/mul.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/phonemizers/mwl.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/phonemizers/vi.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/phonemizers/zh.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/thirdparty/__init__.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/thirdparty/arpa2ipa.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/thirdparty/bw2ipa.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/thirdparty/cotovia/cotovia_aarch64 +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/thirdparty/cotovia/cotovia_x86_64 +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/thirdparty/hangul2ipa.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/thirdparty/ko_tables/aspiration.csv +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/thirdparty/ko_tables/assimilation.csv +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/thirdparty/ko_tables/double_coda.csv +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/thirdparty/ko_tables/hanja.tsv +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/thirdparty/ko_tables/ipa.csv +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/thirdparty/ko_tables/neutralization.csv +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/thirdparty/ko_tables/tensification.csv +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/thirdparty/ko_tables/yale.csv +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/thirdparty/kog2p/__init__.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/thirdparty/kog2p/rulebook.txt +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/thirdparty/mantoq/__init__.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/thirdparty/mantoq/buck/__init__.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/thirdparty/mantoq/buck/phonetise_buckwalter.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/thirdparty/mantoq/buck/symbols.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/thirdparty/mantoq/buck/tokenization.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/thirdparty/mantoq/num2words.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/thirdparty/mantoq/pyarabic/__init__.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/thirdparty/mantoq/pyarabic/arabrepr.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/thirdparty/mantoq/pyarabic/araby.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/thirdparty/mantoq/pyarabic/named_const.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/thirdparty/mantoq/pyarabic/normalize.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/thirdparty/mantoq/pyarabic/number.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/thirdparty/mantoq/pyarabic/number_const.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/thirdparty/mantoq/pyarabic/stack.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/thirdparty/mantoq/pyarabic/trans.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/thirdparty/mantoq/unicode_symbol2label.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/thirdparty/phonikud/__init__.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/thirdparty/tashkeel/LICENSE +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/thirdparty/tashkeel/SOURCE +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/thirdparty/tashkeel/__init__.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/thirdparty/tashkeel/hint_id_map.json +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/thirdparty/tashkeel/input_id_map.json +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/thirdparty/tashkeel/model.onnx +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/thirdparty/tashkeel/target_id_map.json +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/thirdparty/zh_num.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/util.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx/voice.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx.egg-info/dependency_links.txt +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx.egg-info/top_level.txt +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx_train/export_onnx.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx_train/norm_audio/__init__.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx_train/norm_audio/trim.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx_train/norm_audio/vad.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx_train/preprocess.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx_train/train.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx_train/vits/__init__.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx_train/vits/attentions.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx_train/vits/commons.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx_train/vits/config.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx_train/vits/dataset.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx_train/vits/lightning.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx_train/vits/losses.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx_train/vits/mel_processing.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx_train/vits/models.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx_train/vits/modules.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx_train/vits/monotonic_align/__init__.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx_train/vits/monotonic_align/setup.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx_train/vits/transforms.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx_train/vits/utils.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/phoonnx_train/vits/wavfile.py +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/setup.cfg +0 -0
- {phoonnx-0.2.7a1 → phoonnx-0.3.0a1}/setup.py +0 -0
@@ -56,6 +56,7 @@ class PhonemeType(str, Enum):
|
|
56
56
|
OPENPHONEMIZER = "openphonemizer" # en
|
57
57
|
G2PEN = "g2pen" # en
|
58
58
|
|
59
|
+
TUGAPHONE = "tugaphone" # pt
|
59
60
|
G2PFA = "g2pfa"
|
60
61
|
OPENJTALK = "openjtalk" # ja
|
61
62
|
CUTLET = "cutlet" # ja
|
@@ -395,7 +396,7 @@ def get_phonemizer(phoneme_type: PhonemeType,
|
|
395
396
|
from phoonnx.phonemizers import (EpitranPhonemizer, EspeakPhonemizer, OpenPhonemizer, OpenJTaklPhonemizer,
|
396
397
|
ByT5Phonemizer, CharsiuPhonemizer, DeepPhonemizer, PersianPhonemizer,
|
397
398
|
G2pCPhonemizer, G2pMPhonemizer, G2PKPhonemizer, G2PEnPhonemizer,
|
398
|
-
TransphonePhonemizer, MirandesePhonemizer, GoruutPhonemizer,
|
399
|
+
TransphonePhonemizer, MirandesePhonemizer, GoruutPhonemizer, TugaphonePhonemizer,
|
399
400
|
GruutPhonemizer, GraphemePhonemizer, MantoqPhonemizer, MisakiPhonemizer,
|
400
401
|
KoG2PPhonemizer, PypinyinPhonemizer, PyKakasiPhonemizer, CotoviaPhonemizer,
|
401
402
|
CutletPhonemizer, PhonikudPhonemizer, VIPhonemePhonemizer, XpinyinPhonemizer,
|
@@ -404,6 +405,8 @@ def get_phonemizer(phoneme_type: PhonemeType,
|
|
404
405
|
phonemizer = EspeakPhonemizer()
|
405
406
|
elif phoneme_type == PhonemeType.BYT5:
|
406
407
|
phonemizer = ByT5Phonemizer(model)
|
408
|
+
elif phoneme_type == PhonemeType.TUGAPHONE:
|
409
|
+
phonemizer = TugaphonePhonemizer()
|
407
410
|
elif phoneme_type == PhonemeType.CHARSIU:
|
408
411
|
phonemizer = CharsiuPhonemizer(model)
|
409
412
|
elif phoneme_type == PhonemeType.GRUUT:
|
@@ -7,6 +7,7 @@ from phoonnx.phonemizers.vi import VIPhonemePhonemizer
|
|
7
7
|
from phoonnx.phonemizers.he import PhonikudPhonemizer
|
8
8
|
from phoonnx.phonemizers.ar import MantoqPhonemizer
|
9
9
|
from phoonnx.phonemizers.fa import PersianPhonemizer
|
10
|
+
from phoonnx.phonemizers.pt import TugaphonePhonemizer
|
10
11
|
from phoonnx.phonemizers.ja import PyKakasiPhonemizer, CutletPhonemizer, OpenJTaklPhonemizer
|
11
12
|
from phoonnx.phonemizers.ko import KoG2PPhonemizer, G2PKPhonemizer
|
12
13
|
from phoonnx.phonemizers.zh import (G2pCPhonemizer, G2pMPhonemizer, PypinyinPhonemizer,
|
@@ -18,6 +19,7 @@ from phoonnx.phonemizers.mwl import MirandesePhonemizer
|
|
18
19
|
Phonemizer = Union[
|
19
20
|
MisakiPhonemizer,
|
20
21
|
ByT5Phonemizer,
|
22
|
+
TugaphonePhonemizer,
|
21
23
|
UnicodeCodepointPhonemizer,
|
22
24
|
CharsiuPhonemizer,
|
23
25
|
EspeakPhonemizer,
|
@@ -0,0 +1,57 @@
|
|
1
|
+
from phoonnx.phonemizers.base import BasePhonemizer
|
2
|
+
from phoonnx.config import Alphabet
|
3
|
+
|
4
|
+
|
5
|
+
class TugaphonePhonemizer(BasePhonemizer):
|
6
|
+
|
7
|
+
def __init__(self):
|
8
|
+
from tugaphone import TugaPhonemizer
|
9
|
+
self.tuga = TugaPhonemizer()
|
10
|
+
super().__init__(Alphabet.IPA)
|
11
|
+
|
12
|
+
@classmethod
|
13
|
+
def get_lang(cls, target_lang: str) -> str:
|
14
|
+
"""
|
15
|
+
Validates and returns the closest supported language code.
|
16
|
+
|
17
|
+
Args:
|
18
|
+
target_lang (str): The language code to validate.
|
19
|
+
|
20
|
+
Returns:
|
21
|
+
str: The validated language code.
|
22
|
+
|
23
|
+
Raises:
|
24
|
+
ValueError: If the language code is unsupported.
|
25
|
+
"""
|
26
|
+
# this check is here only to throw an exception if invalid language is provided
|
27
|
+
return cls.match_lang(target_lang, ["pt-PT", "pt-BR", "pt-AO", "pt-MZ", "pt-TL"])
|
28
|
+
|
29
|
+
def phonemize_string(self, text: str, lang: str) -> str:
|
30
|
+
lang = self.get_lang(lang)
|
31
|
+
# TODO - support regional dialects
|
32
|
+
return self.tuga.phonemize_sentence(text, lang)
|
33
|
+
|
34
|
+
|
35
|
+
|
36
|
+
if __name__ == "__main__":
|
37
|
+
|
38
|
+
pho = TugaphonePhonemizer()
|
39
|
+
|
40
|
+
sentences = [
|
41
|
+
"O gato dorme.",
|
42
|
+
"Tu falas português muito bem.",
|
43
|
+
"O comboio chegou à estação.",
|
44
|
+
"A menina comeu o pão todo.",
|
45
|
+
"Vou pôr a manteiga no frigorífico.",
|
46
|
+
"Ele está a trabalhar no escritório.",
|
47
|
+
"Choveu muito ontem à noite.",
|
48
|
+
"A rapariga comprou um telemóvel novo.",
|
49
|
+
"Vamos tomar um pequeno-almoço.",
|
50
|
+
"O carro ficou sem gasolina."
|
51
|
+
]
|
52
|
+
|
53
|
+
for s in sentences:
|
54
|
+
print(s)
|
55
|
+
for code in ["pt-PT", "pt-BR", "pt-AO", "pt-MZ", "pt-TL"]:
|
56
|
+
print(f"{code} → {pho.phonemize_string(s, code)}")
|
57
|
+
print("######")
|
@@ -26,6 +26,7 @@ phoonnx/phonemizers/ja.py
|
|
26
26
|
phoonnx/phonemizers/ko.py
|
27
27
|
phoonnx/phonemizers/mul.py
|
28
28
|
phoonnx/phonemizers/mwl.py
|
29
|
+
phoonnx/phonemizers/pt.py
|
29
30
|
phoonnx/phonemizers/vi.py
|
30
31
|
phoonnx/phonemizers/zh.py
|
31
32
|
phoonnx/thirdparty/__init__.py
|
@@ -93,6 +94,7 @@ phoonnx_train/../phoonnx/phonemizers/ja.py
|
|
93
94
|
phoonnx_train/../phoonnx/phonemizers/ko.py
|
94
95
|
phoonnx_train/../phoonnx/phonemizers/mul.py
|
95
96
|
phoonnx_train/../phoonnx/phonemizers/mwl.py
|
97
|
+
phoonnx_train/../phoonnx/phonemizers/pt.py
|
96
98
|
phoonnx_train/../phoonnx/phonemizers/vi.py
|
97
99
|
phoonnx_train/../phoonnx/phonemizers/zh.py
|
98
100
|
phoonnx_train/../phoonnx/thirdparty/__init__.py
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|