README.md: improve wording and make Corrado's name more visible
[SaveMySugar/python3-savemysugar.git] / src / savemysugar / MorseTranslator.py
index 8184829..d52902d 100755 (executable)
@@ -138,7 +138,7 @@ class MorseTranslator(object):
 
     def sanitize_text(self, text):
         sanitized = text.lower()
 
     def sanitize_text(self, text):
         sanitized = text.lower()
-        sanitized = re.sub(r"[^a-z0-9.,?\'\"/() \-=\+@]", "", sanitized)
+        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)
         sanitized = re.sub(r"\s+", " ", sanitized)
         sanitized = re.sub(r"^\s+", "", sanitized)
         sanitized = re.sub(r"\s+$", "", sanitized)
@@ -161,7 +161,6 @@ class MorseTranslator(object):
     def sanitize_morse(self, morse):
         sanitized = re.sub("_", "-", morse)
         sanitized = re.sub(r"[^\-\.\/]", " ", sanitized)
     def sanitize_morse(self, morse):
         sanitized = re.sub("_", "-", morse)
         sanitized = re.sub(r"[^\-\.\/]", " ", sanitized)
-        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"\s+", " ", sanitized)
         sanitized = re.sub(r"( ?/ ?)+", " / ", sanitized)
         sanitized = re.sub(r"^[ /]+", "", sanitized)