Spaces:
Runtime error
Runtime error
File size: 903 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 28 29 30 31 |
import os
import unittest
import warnings
from TTS.tts.utils.text.belarusian.phonemizer import belarusian_text_to_phonemes
_TEST_CASES = """
Π€Π°Π½Π΅ΡΡΡΠ½Ρ ΠΊΠ°Π½Π²Π΅ΡΡΠ°Ρ/fanΚ²ΙΛtΙ¨tΝ‘ΚnΙ¨ kanΛvΚ²Ιrtar
ΠΡΡΠ°ΠΊ ΠΌΡ ΠΏΡΠ°ΡΠ°Π²Π°Π»Ρ/ΛΙ£Ιtak ΛmΙ¨ pratΝ‘saΛvalΚ²i
"""
class TestText(unittest.TestCase):
def test_belarusian_text_to_phonemes(self):
try:
os.environ["BEL_FANETYKA_JAR"]
except KeyError:
warnings.warn(
"You need to define 'BEL_FANETYKA_JAR' environment variable as path to the fanetyka.jar file to test Belarusian phonemizer",
Warning,
)
return
for line in _TEST_CASES.strip().split("\n"):
text, phonemes = line.split("/")
self.assertEqual(belarusian_text_to_phonemes(text), phonemes)
if __name__ == "__main__":
unittest.main()
|