Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
CHANGED
|
@@ -89,7 +89,8 @@ def normalize(text):
|
|
| 89 |
text = re.sub(r'(?<=\d),(?=\d)', '', text)
|
| 90 |
text = re.sub(r'(?<=\d)-(?=\d)', ' to ', text) # TODO: could be minus
|
| 91 |
text = re.sub(r'(?<=\d)S', ' S', text)
|
| 92 |
-
text = re.sub(r"(?<=[A-Z])'?s",
|
|
|
|
| 93 |
text = re.sub(r'(?:[A-Za-z]\.){2,} [a-z]', lambda m: m.group().replace('.', '-'), text)
|
| 94 |
text = re.sub(r'(?i)(?<=[A-Z])\.(?=[A-Z])', '-', text)
|
| 95 |
return parens_to_angles(text).strip()
|
|
|
|
| 89 |
text = re.sub(r'(?<=\d),(?=\d)', '', text)
|
| 90 |
text = re.sub(r'(?<=\d)-(?=\d)', ' to ', text) # TODO: could be minus
|
| 91 |
text = re.sub(r'(?<=\d)S', ' S', text)
|
| 92 |
+
text = re.sub(r"(?<=[A-Z])'?s\b", "'S", text)
|
| 93 |
+
text = re.sub(r"(?<=X')S\b", 's', text)
|
| 94 |
text = re.sub(r'(?:[A-Za-z]\.){2,} [a-z]', lambda m: m.group().replace('.', '-'), text)
|
| 95 |
text = re.sub(r'(?i)(?<=[A-Z])\.(?=[A-Z])', '-', text)
|
| 96 |
return parens_to_angles(text).strip()
|