From ff7c3858389ba250f761d76592cb060ac6be05c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eren=20G=C3=B6lge?= Date: Fri, 19 Nov 2021 10:37:12 +0100 Subject: [PATCH] Fix BasePhonemizer --- TTS/tts/utils/text/phonemizers/base.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/TTS/tts/utils/text/phonemizers/base.py b/TTS/tts/utils/text/phonemizers/base.py index a14a73bc..249c8bce 100644 --- a/TTS/tts/utils/text/phonemizers/base.py +++ b/TTS/tts/utils/text/phonemizers/base.py @@ -92,8 +92,12 @@ class BasePhonemizer(abc.ABC): def _phonemize_preprocess(self, text) -> Tuple[List[str], List]: """Preprocess the text before phonemization + 1. remove spaces + 2. remove punctuation + Override this if you need a different behaviour """ + text = text.strip() if self._keep_puncs: # a tuple (text, punctuation marks) return self._punctuator.strip_to_restore(text)