Fix BasePhonemizer

This commit is contained in:
Eren Gölge 2021-11-19 10:37:12 +01:00
parent 10d435ce77
commit ff7c385838
1 changed files with 4 additions and 0 deletions

View File

@ -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)