hexgrad commited on
Commit
59ea41a
·
verified ·
1 Parent(s): 343970c

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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'(?<=\d):00\b', " 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)
 
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)