diff --git a/deepspeech/frontend/featurizer/text_featurizer.py b/deepspeech/frontend/featurizer/text_featurizer.py index 026595c2998cbd8a74dc3f3a23a5505574f459c5..c70ee74d8fe7266f1663a0e6b39ecfe5198faafc 100644 --- a/deepspeech/frontend/featurizer/text_featurizer.py +++ b/deepspeech/frontend/featurizer/text_featurizer.py @@ -118,8 +118,10 @@ class TextFeaturizer(): """ text = text.strip() if replace_space: - text = text.replace(" ", SPACE) - return list(text) + text_list = [SPACE if item == " " else item for item in list(text)] + else: + text_list = list(text) + return text_list def char_detokenize(self, tokens): """Character detokenizer.