Update app.py
Browse files
app.py
CHANGED
@@ -22,7 +22,7 @@ def remove_accented_chars(text):
|
|
22 |
text = unicodedata.normalize('NFC', text).encode('ascii', 'ignore').decode('utf-8', 'ignore')
|
23 |
return text
|
24 |
|
25 |
-
|
26 |
pattern = r'[^a-zA-Z0-9\s]' if not remove_digits else r'[^a-zA-Z\s]'
|
27 |
text = re.sub(pattern, '', text)
|
28 |
return text
|
|
|
22 |
text = unicodedata.normalize('NFC', text).encode('ascii', 'ignore').decode('utf-8', 'ignore')
|
23 |
return text
|
24 |
|
25 |
+
def remove_special_characters(text, remove_digits=False):
|
26 |
pattern = r'[^a-zA-Z0-9\s]' if not remove_digits else r'[^a-zA-Z\s]'
|
27 |
text = re.sub(pattern, '', text)
|
28 |
return text
|