From 8fbea20de39b563de8e4e89637278711c9a19e76 Mon Sep 17 00:00:00 2001 From: alvinn Date: Mon, 4 Mar 2024 21:05:12 +0200 Subject: [PATCH] remove leading and trailing whitespaces --- utils/text_norm_whisper_like/english.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/utils/text_norm_whisper_like/english.py b/utils/text_norm_whisper_like/english.py index a064c35..b9bf2e1 100644 --- a/utils/text_norm_whisper_like/english.py +++ b/utils/text_norm_whisper_like/english.py @@ -670,4 +670,7 @@ def __call__(self, s: str): s = re.sub(r"\s+", " ", s) # replace any successive whitespaces with a space + s = re.sub(r"^\s+|\s+$", "", s) + # remove leading and trailing whitespaces + return s