Update app.py
Browse files
app.py
CHANGED
|
@@ -21,7 +21,7 @@ def preprocess_for_bm25(text):
|
|
| 21 |
text = text.replace("...", " _ELLIPSIS_ ")
|
| 22 |
|
| 23 |
# Add space before and after punctuation (except "_ELLIPSIS_")
|
| 24 |
-
text = re.sub(r'([.,!?()\'
|
| 25 |
#text = text.replace("'s", " 's")
|
| 26 |
|
| 27 |
# Restore "..." from the placeholder
|
|
|
|
| 21 |
text = text.replace("...", " _ELLIPSIS_ ")
|
| 22 |
|
| 23 |
# Add space before and after punctuation (except "_ELLIPSIS_")
|
| 24 |
+
text = re.sub(r'([.,!?()"\'])', r' \1', text) # General case for punctuation
|
| 25 |
#text = text.replace("'s", " 's")
|
| 26 |
|
| 27 |
# Restore "..." from the placeholder
|