mirror of
https://github.com/wassname/TTS.git
synced 2026-09-11 12:00:24 +08:00
bos char addded
This commit is contained in:
@@ -43,7 +43,7 @@ def phoneme_to_sequence(text, cleaner_names, language):
|
||||
'''
|
||||
TODO: This ignores punctuations
|
||||
'''
|
||||
sequence = []
|
||||
sequence = [_phonemes_to_id['^']]
|
||||
clean_text = _clean_text(text, cleaner_names)
|
||||
phonemes = text2phone(clean_text, language)
|
||||
# print(phonemes.replace('|', ''))
|
||||
@@ -81,7 +81,7 @@ def text_to_sequence(text, cleaner_names):
|
||||
List of integers corresponding to the symbols in the text
|
||||
'''
|
||||
sequence = []
|
||||
|
||||
sequence = [_phonemes_to_id['^']]
|
||||
# Check for curly braces and treat their contents as ARPAbet:
|
||||
while len(text):
|
||||
m = _curly_re.match(text)
|
||||
|
||||
@@ -9,6 +9,7 @@ from utils.text import cmudict
|
||||
|
||||
_pad = '_'
|
||||
_eos = '~'
|
||||
_bos = '^'
|
||||
_characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!\'(),-.:;? '
|
||||
_punctuations = '!\'(),-.:;? '
|
||||
_phoneme_punctuations = '.!;:,?'
|
||||
@@ -24,8 +25,8 @@ _phonemes = sorted(list(set(_phonemes)))
|
||||
_arpabet = ['@' + s for s in _phonemes]
|
||||
|
||||
# Export all symbols:
|
||||
symbols = [_pad, _eos] + list(_characters) + _arpabet
|
||||
phonemes = [_pad, _eos] + list(_phonemes) + list(_punctuations)
|
||||
symbols = [_pad, _eos, _bos] + list(_characters) + _arpabet
|
||||
phonemes = [_pad, _eos, _bos] + list(_phonemes) + list(_punctuations)
|
||||
|
||||
if __name__ == '__main__':
|
||||
print(" > TTS symbols ")
|
||||
|
||||
Reference in New Issue
Block a user