mirror of https://github.com/coqui-ai/TTS.git
Fixed lint errors
This commit is contained in:
parent
0536aa6d0f
commit
f921a05bdb
|
@ -1 +1 @@
|
|||
from .text import japanese_text2phone
|
||||
from .text import japanese_text2phone
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
import re
|
||||
import MeCab
|
||||
from typing import List, Tuple
|
||||
|
||||
_CONVRULES = [
|
||||
# Conversion of 2 letters
|
||||
|
@ -364,7 +363,7 @@ def text2kata(text: str) -> str:
|
|||
else:
|
||||
if word in _SYMBOL_TOKENS:
|
||||
res.append(word)
|
||||
elif word == 'っ' or word == 'ッ':
|
||||
elif word in ('っ', 'ッ'):
|
||||
res.append('ッ')
|
||||
elif word in _NO_YOMI_TOKENS:
|
||||
pass
|
||||
|
@ -377,4 +376,4 @@ def japanese_text2phone(text: str) -> str:
|
|||
"""
|
||||
res = text2kata(text)
|
||||
res = kata2phoneme(res)
|
||||
return res.replace(' ', '')
|
||||
return res.replace(' ', '')
|
||||
|
|
|
@ -19,4 +19,4 @@ class TestText(unittest.TestCase):
|
|||
self.assertEqual(japanese_text2phone(text), phone)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
unittest.main()
|
||||
|
|
|
@ -39,7 +39,8 @@ def text2phone(text, language):
|
|||
if language == "zh-CN":
|
||||
ph = chinese_text_to_phonemes(text)
|
||||
return ph
|
||||
elif language == "ja-jp":
|
||||
|
||||
if language == "ja-jp":
|
||||
from TTS.tts.utils.japanese import japanese_text2phone
|
||||
ph = japanese_text2phone(text)
|
||||
return ph
|
||||
|
|
Loading…
Reference in New Issue