mirror of
https://github.com/wassname/TTS.git
synced 2026-09-17 12:00:07 +08:00
Korean Phonemizer (#1822)
* Update requirements.txt install jamo for korean * Update formatters.py add KSS formatter KSS is a korean single speech dataset (12hours) * Add files via upload add phonemizer for korean * Add files via upload add korean phonemizer * Update requirements.txt * change code style with `black` and `pylint` * reflecting pylint's Evaluation * reflecting pylint's Evaluation * reflecting pylint's Evaluation-2 * isort * edit about separator write test case and add 'nltk' for requirements.txt * add korean g2p (g2pkk) * isort * TTS/tts/utils/text/phonemizers/ko_kr_phonemizer.py:43:24: W0621: Redefining name 'text' from outer scope (line 58) (redefined-outer-name) TTS/tts/utils/text/korean/korean.py:28:8: R1705: Unnecessary "else" after "return" (no-else-return) * black
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import unittest
|
||||
|
||||
from TTS.tts.utils.text.korean.phonemizer import korean_text_to_phonemes
|
||||
|
||||
_TEST_CASES = """
|
||||
포상은 열심히 한 아이에게만 주어지기 때문에 포상인 것입니다./포상으 녈심히 하 나이에게만 주어지기 때무네 포상인 거심니다.
|
||||
오늘은 8월 31일 입니다./오느른 파뤌 삼시비리 림니다.
|
||||
친구 100명 만들기가 목표입니다./친구 뱅명 만들기가 목표임니다.
|
||||
A부터 Z까지 입니다./에이부터 제트까지 임니다.
|
||||
이게 제 마음이에요./이게 제 마으미에요.
|
||||
"""
|
||||
_TEST_CASES_EN = """
|
||||
이제야 이쪽을 보는구나./IJeYa IJjoGeul BoNeunGuNa.
|
||||
크고 맛있는 cake를 부탁해요./KeuGo MaSinNeun KeIKeuLeul BuTaKaeYo.
|
||||
전부 거짓말이야./JeonBu GeoJinMaLiYa.
|
||||
좋은 노래를 찾았어요./JoEun NoLaeLeul ChaJaSseoYo.
|
||||
"""
|
||||
|
||||
|
||||
class TestText(unittest.TestCase):
|
||||
def test_korean_text_to_phonemes(self):
|
||||
for line in _TEST_CASES.strip().split("\n"):
|
||||
text, phone = line.split("/")
|
||||
self.assertEqual(korean_text_to_phonemes(text), phone)
|
||||
for line in _TEST_CASES_EN.strip().split("\n"):
|
||||
text, phone = line.split("/")
|
||||
self.assertEqual(korean_text_to_phonemes(text, character="english"), phone)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user