mirror of https://github.com/coqui-ai/TTS.git
Add doc examples
This commit is contained in:
parent
99d9bb7a17
commit
20e5dd3678
|
@ -66,6 +66,14 @@ class ESpeak(BasePhonemizer):
|
||||||
|
|
||||||
keep_puncs (bool):
|
keep_puncs (bool):
|
||||||
If True, keep the punctuations after phonemization. Defaults to True.
|
If True, keep the punctuations after phonemization. Defaults to True.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
>>> from TTS.tts.utils.text.phonemizers import ESpeak
|
||||||
|
>>> phonemizer = ESpeak("tr")
|
||||||
|
>>> phonemizer.phonemize("Bu Türkçe, bir örnektir.", separator="|")
|
||||||
|
'b|ʊ t|ˈø|r|k|tʃ|ɛ, b|ɪ|r œ|r|n|ˈɛ|c|t|ɪ|r.'
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
_ESPEAK_LIB = _DEF_ESPEAK_LIB
|
_ESPEAK_LIB = _DEF_ESPEAK_LIB
|
||||||
|
@ -140,14 +148,14 @@ class ESpeak(BasePhonemizer):
|
||||||
count += 1
|
count += 1
|
||||||
return langs
|
return langs
|
||||||
|
|
||||||
def version(self):
|
def version(self) -> str:
|
||||||
"""Get the version of the used backend.
|
"""Get the version of the used backend.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
str: Version of the used backend.
|
str: Version of the used backend.
|
||||||
"""
|
"""
|
||||||
args = ["--version"]
|
args = ["--version"]
|
||||||
for line in self._espeak_exe(args, sync=True):
|
for line in _espeak_exe(_DEF_ESPEAK_LIB, args, sync=True):
|
||||||
version = line.decode("utf8").strip().split()[2]
|
version = line.decode("utf8").strip().split()[2]
|
||||||
logging.debug("line: %s" % repr(line))
|
logging.debug("line: %s" % repr(line))
|
||||||
return version
|
return version
|
||||||
|
|
|
@ -30,6 +30,13 @@ class Gruut(BasePhonemizer):
|
||||||
|
|
||||||
keep_stress (bool):
|
keep_stress (bool):
|
||||||
If true, keep the stress characters after phonemization. Defaults to False.
|
If true, keep the stress characters after phonemization. Defaults to False.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
>>> from TTS.tts.utils.text.phonemizers.gruut_wrapper import Gruut
|
||||||
|
>>> phonemizer = Gruut('en-us')
|
||||||
|
>>> phonemizer.phonemize("Be a voice, not an! echo?", separator="|")
|
||||||
|
'b|i| ə| v|ɔ|ɪ|s, n|ɑ|t| ə|n! ɛ|k|o|ʊ?'
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
|
|
Loading…
Reference in New Issue