X-Git-Url: https://git.ao2.it/SaveMySugar/python3-savemysugar.git/blobdiff_plain/8fc5baa85b3b0754f2999c065d06c78439c6fd4e..3cbe65bd46e6044a6d84a8a515bd58cf8af8ca44:/src/savemysugar/MorseTranslator.py?ds=sidebyside diff --git a/src/savemysugar/MorseTranslator.py b/src/savemysugar/MorseTranslator.py index d52902d..068a0b9 100755 --- a/src/savemysugar/MorseTranslator.py +++ b/src/savemysugar/MorseTranslator.py @@ -140,8 +140,6 @@ class MorseTranslator(object): sanitized = text.lower() sanitized = re.sub(r"[^a-z0-9.,:?\'-/()\"=\+@ ]", "", sanitized) sanitized = re.sub(r"\s+", " ", sanitized) - sanitized = re.sub(r"^\s+", "", sanitized) - sanitized = re.sub(r"\s+$", "", sanitized) return sanitized def char_to_signal(self, character): @@ -163,8 +161,6 @@ class MorseTranslator(object): sanitized = re.sub(r"[^\-\.\/]", " ", sanitized) sanitized = re.sub(r"\s+", " ", sanitized) sanitized = re.sub(r"( ?/ ?)+", " / ", sanitized) - sanitized = re.sub(r"^[ /]+", "", sanitized) - sanitized = re.sub(r"[ /]+$", "", sanitized) return sanitized def signal_to_character(self, signal):