Spaces:
Runtime error
Runtime error
File size: 867 Bytes
45ee559 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
import unittest
from TTS.tts.utils.text.japanese.phonemizer import japanese_text_to_phonemes
_TEST_CASES = """
ใฉใกใใซ่กใใพใใ๏ผ/dochiraniikimasuka?
ไปๆฅใฏๆธฉๆณใซใ่กใใพใใ/kyo:waoNseNni,ikimasu.
ใAใใใใZใใพใงใงใใ/e:karazeqtomadedesu.
ใใใงใใญ๏ผ/so:desune!
ใฏใธใฉใฏๅบไนณ้กใงใใ/kujirawahonyu:ruidesu.
ใดใฃใใฃใชใ่ฆใพใใ/bidioomimasu.
ไปๆฅใฏ๏ผๆ22ๆฅใงใ/kyo:wahachigatsuniju:ninichidesu
xyzใจฮฑฮฒฮณ/eqkusuwaizeqtotoarufabe:tagaNma
ๅคๆฎตใฏ$12.34ใงใ/nedaNwaju:niteNsaNyoNdorudesu
"""
class TestText(unittest.TestCase):
def test_japanese_text_to_phonemes(self):
for line in _TEST_CASES.strip().split("\n"):
text, phone = line.split("/")
self.assertEqual(japanese_text_to_phonemes(text), phone)
if __name__ == "__main__":
unittest.main()
|