Spaces:
Running
on
Zero
Running
on
Zero
Upload app.py
Browse files
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 |
-
|
|
|
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.')
|