mirror of
https://github.com/coqui-ai/TTS.git
synced 2025-12-25 12:49:29 +01:00
Fix tokenizer for punc only (#1717)
This commit is contained in:
@@ -137,7 +137,7 @@ class Punctuation:
|
||||
|
||||
# nothing have been phonemized, returns the puncs alone
|
||||
if not text:
|
||||
return ["".join(m.mark for m in puncs)]
|
||||
return ["".join(m.punc for m in puncs)]
|
||||
|
||||
current = puncs[0]
|
||||
|
||||
|
||||
@@ -30,6 +30,13 @@ class TestTTSTokenizer(unittest.TestCase):
|
||||
test_hat = self.tokenizer_ph.ids_to_text(ids)
|
||||
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):
|
||||
text = "Bu bir Örnek."
|
||||
self.tokenizer_ph.use_eos_bos = True
|
||||
|
||||
Reference in New Issue
Block a user