From 46692b3b93bac698dbcb12a7ad059cf47f2080a9 Mon Sep 17 00:00:00 2001 From: huangyuxin Date: Fri, 24 Sep 2021 05:18:42 +0000 Subject: [PATCH] fix the text_featurize --- deepspeech/frontend/featurizer/text_featurizer.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/deepspeech/frontend/featurizer/text_featurizer.py b/deepspeech/frontend/featurizer/text_featurizer.py index 026595c29..c70ee74d8 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.