mirror of https://github.com/coqui-ai/TTS.git
Fix tokenizer for punc only (#1717)
This commit is contained in:
parent
9e00e31e37
commit
5cef6facb0
|
@ -137,7 +137,7 @@ class Punctuation:
|
||||||
|
|
||||||
# nothing have been phonemized, returns the puncs alone
|
# nothing have been phonemized, returns the puncs alone
|
||||||
if not text:
|
if not text:
|
||||||
return ["".join(m.mark for m in puncs)]
|
return ["".join(m.punc for m in puncs)]
|
||||||
|
|
||||||
current = puncs[0]
|
current = puncs[0]
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,13 @@ class TestTTSTokenizer(unittest.TestCase):
|
||||||
test_hat = self.tokenizer_ph.ids_to_text(ids)
|
test_hat = self.tokenizer_ph.ids_to_text(ids)
|
||||||
self.assertEqual(text_ph, test_hat)
|
self.assertEqual(text_ph, test_hat)
|
||||||
|
|
||||||
|
def test_text_to_ids_phonemes_punctuation(self):
|
||||||
|
text = "..."
|
||||||
|
text_ph = self.ph.phonemize(text, separator="")
|
||||||
|
ids = self.tokenizer_ph.text_to_ids(text)
|
||||||
|
test_hat = self.tokenizer_ph.ids_to_text(ids)
|
||||||
|
self.assertEqual(text_ph, test_hat)
|
||||||
|
|
||||||
def test_text_to_ids_phonemes_with_eos_bos(self):
|
def test_text_to_ids_phonemes_with_eos_bos(self):
|
||||||
text = "Bu bir Örnek."
|
text = "Bu bir Örnek."
|
||||||
self.tokenizer_ph.use_eos_bos = True
|
self.tokenizer_ph.use_eos_bos = True
|
||||||
|
|
Loading…
Reference in New Issue