Spaces:
Running
on
Zero
Running
on
Zero
Upload app.py
Browse files
app.py
CHANGED
@@ -78,7 +78,7 @@ def normalize(text):
|
|
78 |
text = re.sub(r'\d*\.\d+|\b\d{4}s?\b', split_num, text)
|
79 |
text = re.sub(r'(?<=\d),(?=\d)', '', text)
|
80 |
text = re.sub(r'(?<=\d)-(?=\d)', ' to ', text) # TODO: could be minus
|
81 |
-
text = re.sub(r'(
|
82 |
text = re.sub(r'(?<=\d):(?=\d)', ' ', text)
|
83 |
text = re.sub(r'(?<=\d)S', ' S', text)
|
84 |
text = re.sub(r"(?<=[A-Z])'?s", lambda m: m.group().upper(), text)
|
|
|
78 |
text = re.sub(r'\d*\.\d+|\b\d{4}s?\b', split_num, text)
|
79 |
text = re.sub(r'(?<=\d),(?=\d)', '', text)
|
80 |
text = re.sub(r'(?<=\d)-(?=\d)', ' to ', text) # TODO: could be minus
|
81 |
+
text = re.sub(r'(?<!:)\b(?:[1-9]|1[0-2]):00\b(?!:)', lambda m: m.group()[:-3] + " o'clock", text)
|
82 |
text = re.sub(r'(?<=\d):(?=\d)', ' ', text)
|
83 |
text = re.sub(r'(?<=\d)S', ' S', text)
|
84 |
text = re.sub(r"(?<=[A-Z])'?s", lambda m: m.group().upper(), text)
|