remove _phoneme_punctuations

This commit is contained in:
Eren Gölge 2021-02-12 12:10:57 +00:00 committed by Eren Gölge
parent 194f82de51
commit 5b8a6736a7
2 changed files with 6 additions and 5 deletions

View File

@ -6,7 +6,7 @@ import phonemizer
from packaging import version from packaging import version
from phonemizer.phonemize import phonemize from phonemizer.phonemize import phonemize
from TTS.tts.utils.text import cleaners from TTS.tts.utils.text import cleaners
from TTS.tts.utils.text.symbols import (_bos, _eos, _phoneme_punctuations, from TTS.tts.utils.text.symbols import (_bos, _eos, _punctuations,
make_symbols, phonemes, symbols) make_symbols, phonemes, symbols)
@ -24,7 +24,7 @@ _phonemes = phonemes
_CURLY_RE = re.compile(r'(.*?)\{(.+?)\}(.*)') _CURLY_RE = re.compile(r'(.*?)\{(.+?)\}(.*)')
# Regular expression matching punctuations, ignoring empty space # Regular expression matching punctuations, ignoring empty space
PHONEME_PUNCTUATION_PATTERN = r'['+_phoneme_punctuations+']+' PHONEME_PUNCTUATION_PATTERN = r'['+_punctuations+']+'
def text2phone(text, language): def text2phone(text, language):

View File

@ -5,6 +5,8 @@ Defines the set of symbols used in text input to the model.
The default is a set of ASCII characters that works well for English or text that has been run The default is a set of ASCII characters that works well for English or text that has been run
through Unidecode. For other data, you can modify _characters. See TRAINING_DATA.md for details. through Unidecode. For other data, you can modify _characters. See TRAINING_DATA.md for details.
''' '''
def make_symbols(characters, phonemes=None, punctuations='!\'(),-.:;? ', pad='_', eos='~', bos='^'):# pylint: disable=redefined-outer-name def make_symbols(characters, phonemes=None, punctuations='!\'(),-.:;? ', pad='_', eos='~', bos='^'):# pylint: disable=redefined-outer-name
''' Function to create symbols and phonemes ''' ''' Function to create symbols and phonemes '''
_symbols = [pad, eos, bos] + list(characters) _symbols = [pad, eos, bos] + list(characters)
@ -18,15 +20,14 @@ def make_symbols(characters, phonemes=None, punctuations='!\'(),-.:;? ', pad='_'
_symbols += _arpabet _symbols += _arpabet
return _symbols, _phonemes return _symbols, _phonemes
_pad = '_' _pad = '_'
_eos = '~' _eos = '~'
_bos = '^' _bos = '^'
_characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!\'(),-.:;? ' _characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!\'(),-.:;? '
_punctuations = '!\'(),-.:;? ' _punctuations = '!\'(),-.:;? '
_phoneme_punctuations = '.!;:,?' # _phoneme_punctuations = '.!;:,?'
# Phonemes definition # Phonemes definition (All IPA characters)
_vowels = 'iyɨʉɯuɪʏʊeøɘəɵɤoɛœɜɞʌɔæɐaɶɑɒᵻ' _vowels = 'iyɨʉɯuɪʏʊeøɘəɵɤoɛœɜɞʌɔæɐaɶɑɒᵻ'
_non_pulmonic_consonants = 'ʘɓǀɗǃʄǂɠǁʛ' _non_pulmonic_consonants = 'ʘɓǀɗǃʄǂɠǁʛ'
_pulmonic_consonants = 'pbtdʈɖcɟkɡʔɴŋɲɳnɱmʙrʀⱱɾɽɸβfvθðszʃʒʂʐçʝxɣχʁħʕhɦɬɮʋɹɻjɰlɭʎʟ' _pulmonic_consonants = 'pbtdʈɖcɟkɡʔɴŋɲɳnɱmʙrʀⱱɾɽɸβfvθðszʃʒʂʐçʝxɣχʁħʕhɦɬɮʋɹɻjɰlɭʎʟ'