Spaces:
Sleeping
Sleeping
LeireTedCas
commited on
Commit
•
a2504f3
1
Parent(s):
1d1d0b5
Update app.py
Browse files
app.py
CHANGED
@@ -55,9 +55,9 @@ def remove_non_printable(value):
|
|
55 |
#return re.sub(r'[\xa0\n\t\s]|(?<=\w)\\n|(?<=[.,;:!?¿])\\n|\n(?<=\w)\\n|\n(?<=\w)|\n(?<=[.,;:!?¿])|\t(?<=[.,;:!?¿])|(?<=[.,;:!?¿])\\t|(?<=\w)\\t|\t(?<=\w)\\t|\t(?<=\w)|(?<=[.,;:!?¿])\\xa0|(?<=\w)\\xa0|\xa0(?<=\w)\\xa0|\xa0(?<=\w)\xa0(?<=[.,;:!?¿])|', 'ww', value)
|
56 |
#return re.sub(r'\s*[\n\t\xa0]+\s*', ' ', value).strip()
|
57 |
#value = value.replace("\xa0", "").replace("\n", "").replace("\t", "")
|
58 |
-
value = re.sub(r'[\xa0]*|(?<=\s)\\xa0(?=\s)|(?<=\s)\\xa0(?=\S)|(?<=\S)\\xa0(?=\s)|(?<=\S)\\xa0(?=\S)', ' ', value)
|
59 |
-
value = re.sub(r'[\n]*|(?<=\s)\\n(?<=\s)|(?<=\s)\\n(?<=\S)|(?<=\S)\\n(?<=\s)|(?<=\S)\\n(?<=\S)', ' ', value)
|
60 |
-
value = re.sub(r'[\t]*|(?<=\s)\\t(?<=\s)|(?<=\s)\\t(?<=\S)|(?<=\S)\\t(?<=\s)|(?<=\S)\\t(?<=\S)', ' ', value)
|
61 |
return value
|
62 |
return value
|
63 |
|
|
|
55 |
#return re.sub(r'[\xa0\n\t\s]|(?<=\w)\\n|(?<=[.,;:!?¿])\\n|\n(?<=\w)\\n|\n(?<=\w)|\n(?<=[.,;:!?¿])|\t(?<=[.,;:!?¿])|(?<=[.,;:!?¿])\\t|(?<=\w)\\t|\t(?<=\w)\\t|\t(?<=\w)|(?<=[.,;:!?¿])\\xa0|(?<=\w)\\xa0|\xa0(?<=\w)\\xa0|\xa0(?<=\w)\xa0(?<=[.,;:!?¿])|', 'ww', value)
|
56 |
#return re.sub(r'\s*[\n\t\xa0]+\s*', ' ', value).strip()
|
57 |
#value = value.replace("\xa0", "").replace("\n", "").replace("\t", "")
|
58 |
+
#value = re.sub(r'[\xa0]*|(?<=\s)\\xa0(?=\s)|(?<=\s)\\xa0(?=\S)|(?<=\S)\\xa0(?=\s)|(?<=\S)\\xa0(?=\S)', ' ', value)
|
59 |
+
#value = re.sub(r'[\n]*|(?<=\s)\\n(?<=\s)|(?<=\s)\\n(?<=\S)|(?<=\S)\\n(?<=\s)|(?<=\S)\\n(?<=\S)', ' ', value)
|
60 |
+
#value = re.sub(r'[\t]*|(?<=\s)\\t(?<=\s)|(?<=\s)\\t(?<=\S)|(?<=\S)\\t(?<=\s)|(?<=\S)\\t(?<=\S)', ' ', value)
|
61 |
return value
|
62 |
return value
|
63 |
|