Spaces:
Sleeping
Sleeping
Yaron Koresh
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -268,8 +268,8 @@ def xpath_finder(str,pattern):
|
|
268 |
def translate(text,lang):
|
269 |
if text == None or lang == None:
|
270 |
return ""
|
271 |
-
text = re.sub(f'[{
|
272 |
-
lang = re.sub(f'[{
|
273 |
if text == "" or lang == "":
|
274 |
return ""
|
275 |
if len(text) > 38:
|
|
|
268 |
def translate(text,lang):
|
269 |
if text == None or lang == None:
|
270 |
return ""
|
271 |
+
text = re.sub(f'[{punctuation}]', '', re.sub('[\s+]', ' ', text)).lower().strip()
|
272 |
+
lang = re.sub(f'[{punctuation}]', '', re.sub('[\s+]', ' ', lang)).lower().strip()
|
273 |
if text == "" or lang == "":
|
274 |
return ""
|
275 |
if len(text) > 38:
|