hexgrad commited on
Commit
eff6dd2
·
verified ·
1 Parent(s): a710a8c

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -89,7 +89,7 @@ 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\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)
 
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"(?<=[BCDFGHJ-NP-TV-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)