Spaces:
Runtime error
Runtime error
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() | |