mirror of https://github.com/coqui-ai/TTS.git
Move phoneme compuataion to __init__ and put char list to symbols.py
This commit is contained in:
parent
28d45a8d80
commit
c754ca89de
|
@ -67,6 +67,18 @@ def sequence_to_phoneme(sequence):
|
||||||
return result.replace('}{', ' ')
|
return result.replace('}{', ' ')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def text2phone(text):
|
||||||
|
'''
|
||||||
|
Convert graphemes to phonemes.
|
||||||
|
'''
|
||||||
|
try:
|
||||||
|
ph = epi.trans_list(text, normpunc=True)
|
||||||
|
except:
|
||||||
|
ph = None
|
||||||
|
return ph
|
||||||
|
|
||||||
|
|
||||||
def phoneme_to_sequence(text, cleaner_names):
|
def phoneme_to_sequence(text, cleaner_names):
|
||||||
'''
|
'''
|
||||||
TODO: This ignores punctuations
|
TODO: This ignores punctuations
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import epitran
|
|
||||||
epi = epitran.Epitran('eng-Latn')
|
|
||||||
|
|
||||||
# valid_symbols = [
|
# valid_symbols = [
|
||||||
# 'AA', 'AA0', 'AA1', 'AA2', 'AE', 'AE0', 'AE1', 'AE2', 'AH', 'AH0', 'AH1',
|
# 'AA', 'AA0', 'AA1', 'AA2', 'AE', 'AE0', 'AE1', 'AE2', 'AH', 'AH0', 'AH1',
|
||||||
|
|
Loading…
Reference in New Issue