Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'2.1' in FestivalBackend.version(),
reason='festival-2.1 gives different results than further versions '
'for syllable boundaries')
def test_hello():
assert _test('hello world') == ['hh-ax|l-ow w-er-l-d']
assert _test('hello\nworld') == ['hh-ax|l-ow', 'w-er-l-d']
assert _test('hello\nworld\n') == ['hh-ax|l-ow', 'w-er-l-d']
'2.1' in backend.FestivalBackend.version(),
reason='festival-2.1 gives different results than further versions '
'for syllable boundaries')
def test_readme_festival_syll():
_test(u'hello world',
u'hh ax ;esyll l ow ;esyll ;eword w er l d ;esyll ;eword ',
u"-p ' ' -s ';esyll ' -w ';eword ' -b festival -l en-us")
version = (
'phonemizer-' + pkg_resources.get_distribution('phonemizer').version)
# for each backend, check if it is available or not. If so get its version
available = []
unavailable = []
if EspeakBackend.is_available():
available.append(
'espeak-' + ('ng-' if EspeakBackend.is_espeak_ng() else '')
+ EspeakBackend.version())
else: # pragma: nocover
unavailable.append('espeak')
if FestivalBackend.is_available():
available.append('festival-' + FestivalBackend.version())
else: # pragma: nocover
unavailable.append('festival')
if SegmentsBackend.is_available():
available.append('segments-' + SegmentsBackend.version())
else: # pragma: nocover
unavailable.append('segments')
# resumes the backends status in the final version string
if available:
version += '\navailable backends: ' + ', '.join(available)
if unavailable: # pragma: nocover
version += '\nuninstalled backends: ' + ', '.join(unavailable)
return version