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

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -100,11 +100,11 @@ def phonemize(text, voice, norm=True):
100
  # https://en.wiktionary.org/wiki/kokoro#English
101
  if lang in 'ab':
102
  ps = ps.replace('kəkˈoːɹoʊ', 'kˈoʊkəɹoʊ').replace('kəkˈɔːɹəʊ', 'kˈəʊkəɹəʊ')
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.')
 
100
  # https://en.wiktionary.org/wiki/kokoro#English
101
  if lang in 'ab':
102
  ps = ps.replace('kəkˈoːɹoʊ', 'kˈoʊkəɹoʊ').replace('kəkˈɔːɹəʊ', 'kˈəʊkəɹəʊ')
103
+ ps = ps.replace('ʲ', 'j').replace('r', 'ɹ').replace('x', 'k').replace('ɬ', 'l')
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.')