bos char addded

This commit is contained in:
Eren Golge
2019-03-06 22:06:01 +01:00
parent d8add67a2f
commit 5754116c19
7 changed files with 42 additions and 36 deletions
+2 -2
View File
@@ -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)
+3 -2
View File
@@ -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 ")