From abc05b4a4d104ad0d2be76e5d7ac910ba4a14716 Mon Sep 17 00:00:00 2001 From: dabinat Date: Mon, 5 Aug 2019 09:20:13 -0700 Subject: [PATCH] Label validation - Replace hyphens with spaces --- util/text.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/util/text.py b/util/text.py index 7ae6ef3e..4137faa1 100644 --- a/util/text.py +++ b/util/text.py @@ -92,8 +92,9 @@ def validate_label(label): if re.search(r"[0-9]|[(<\[\]&*{]", label) is not None: return None - label = label.replace("-", "") - label = label.replace("_", "") + label = label.replace("-", " ") + label = label.replace("_", " ") + label = re.sub("[ ]{2,}", " ", label) label = label.replace(".", "") label = label.replace(",", "") label = label.replace("?", "")