Spaces:
Running
Running
FoodDesert
commited on
Commit
•
5b174ea
1
Parent(s):
f1da0db
Upload app.py
Browse filesFixing a bug so that multiple "Move Comma Inside Parentheses" can be captured.
app.py
CHANGED
@@ -538,11 +538,10 @@ def augment_bad_entities_with_regex(text):
|
|
538 |
index = match.start(1)
|
539 |
bad_entities.append({"entity":"Remove Final Comma", "start":index, "end":index+1})
|
540 |
|
541 |
-
|
542 |
-
match
|
543 |
-
if match:
|
544 |
index = match.start(1)
|
545 |
-
bad_entities.append({"entity":"Move Comma Inside Parentheses", "start":index, "end":index+1})
|
546 |
|
547 |
return bad_entities
|
548 |
|
|
|
538 |
index = match.start(1)
|
539 |
bad_entities.append({"entity":"Remove Final Comma", "start":index, "end":index+1})
|
540 |
|
541 |
+
# Comma after parentheses, multiple occurrences
|
542 |
+
for match in re.finditer(r'\)\s*(,)\s*[^\s]', text):
|
|
|
543 |
index = match.start(1)
|
544 |
+
bad_entities.append({"entity": "Move Comma Inside Parentheses", "start": index, "end": index + 1})
|
545 |
|
546 |
return bad_entities
|
547 |
|