video-dubbing / TTS /tests /text_tests /test_japanese_phonemizer.py
artificialguybr's picture
Upload 650 files
45ee559
raw
history blame
867 Bytes
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()