add filter for double punctuation in sentences; add homonym, test=tts

pull/2235/head
david.95 2 years ago
parent 9c4763ecce
commit 1edd474bcb

@ -99,7 +99,11 @@ class English(Phonetics):
if (phn in self.vocab_phones and phn not in self.punc) else "sp"
for phn in phones
]
phones_list.append(phones)
# when sentences have double punctuations in the end, like "!\"",or "?\"", will get null list like []
# add judge to filter it
if len(phones) != 0:
# replace unk phone with sp
phones_list.append(phones)
if merge_sentences:
merge_list = sum(phones_list, [])

@ -94,10 +94,12 @@ class Frontend():
large_pinyin.load()
load_phrases_dict({u'开户行': [[u'ka1i'], [u'hu4'], [u'hang2']]})
load_phrases_dict({u'俩个':[[u'lia3ng'],[u'ge4']]})
load_phrases_dict({u'发卡行': [[u'fa4'], [u'ka3'], [u'hang2']]})
load_phrases_dict({u'放款行': [[u'fa4ng'], [u'kua3n'], [u'hang2']]})
load_phrases_dict({u'茧行': [[u'jia3n'], [u'hang2']]})
load_phrases_dict({u'行号': [[u'hang2'], [u'ha4o']]})
load_phrases_dict({u'行政': [[u'xing2'], [u'zhen4g']]})
load_phrases_dict({u'各地': [[u'ge4'], [u'di4']]})
load_phrases_dict({u'借还款': [[u'jie4'], [u'hua2n'], [u'kua3n']]})
load_phrases_dict({u'时间为': [[u'shi2'], [u'jia1n'], [u'we2i']]})

Loading…
Cancel
Save