hexgrad commited on
Commit
9e3a2ff
·
verified ·
1 Parent(s): a7e7cf3

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -30,11 +30,11 @@ def parens_to_angles(s):
30
 
31
  def normalize(text):
32
  # TODO: Custom text normalization rules?
33
- text = re.sub(r'D[Rr]\.(?= [A-Z])', 'Doctor', text)
34
- text = re.sub(r'Mr\.|MR\.(?= [A-Z])', 'Mister', text)
35
- text = re.sub(r'Ms\.|MS\.(?= [A-Z])', 'Miss', text)
36
- text = re.sub(r'Mrs\.|MRS\.(?= [A-Z])', 'Mrs', text)
37
- text = re.sub(r'etc\.(?! [A-Z])', 'etc', text)
38
  text = re.sub(r'\b([Yy])eah\b', r"\1e'a", text)
39
  text = text.replace(chr(8216), "'").replace(chr(8217), "'")
40
  text = text.replace(chr(8220), '"').replace(chr(8221), '"')
 
30
 
31
  def normalize(text):
32
  # TODO: Custom text normalization rules?
33
+ text = re.sub(r'\bD[Rr]\.(?= [A-Z])', 'Doctor', text)
34
+ text = re.sub(r'\b(?:Mr\.|MR\.(?= [A-Z]))', 'Mister', text)
35
+ text = re.sub(r'\b(?:Ms\.|MS\.(?= [A-Z]))', 'Miss', text)
36
+ text = re.sub(r'\b(?:Mrs\.|MRS\.(?= [A-Z]))', 'Mrs', text)
37
+ text = re.sub(r'\betc\.(?! [A-Z])', 'etc', text)
38
  text = re.sub(r'\b([Yy])eah\b', r"\1e'a", text)
39
  text = text.replace(chr(8216), "'").replace(chr(8217), "'")
40
  text = text.replace(chr(8220), '"').replace(chr(8221), '"')