hexgrad commited on
Commit
85cde2d
·
verified ·
1 Parent(s): 5019292

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -103,7 +103,8 @@ def phonemize(text, voice, norm=True):
103
  ps = ps.replace('ʲ', 'j').replace('r', 'ɹ').replace('x', 'k')
104
  ps = ps.replace(' z', 'z')
105
  ps = re.sub(r'(?<=[a-zɹː])(?=hˈʌndɹɪd)', ' ', ps)
106
- ps = re.sub(r'(?<=nˈaɪn)t[iɪ](?!ː)', ('d' if lang == 'a' else 't') + 'i', ps)
 
107
  ps = ''.join(filter(lambda p: p in VOCAB, ps))
108
  if lang == 'j' and any(p in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' for p in ps):
109
  gr.Warning('Japanese tokenizer does not handle English letters.')
 
103
  ps = ps.replace('ʲ', 'j').replace('r', 'ɹ').replace('x', 'k')
104
  ps = ps.replace(' z', 'z')
105
  ps = re.sub(r'(?<=[a-zɹː])(?=hˈʌndɹɪd)', ' ', ps)
106
+ if lang == 'a':
107
+ ps = re.sub(r'(?<=nˈaɪn)ti(?=[;:,.!?¡¿—…"«»“” ]|$)', 'di', ps)
108
  ps = ''.join(filter(lambda p: p in VOCAB, ps))
109
  if lang == 'j' and any(p in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' for p in ps):
110
  gr.Warning('Japanese tokenizer does not handle English letters.')