mirror of
https://github.com/storytold/storyteller-ml.git
synced 2026-10-18 07:41:03 +00:00
16 lines
523 B
Python
16 lines
523 B
Python
from tts.text.phonetization.cmudict import CMUDict
|
|
from tts.text.phonetization.cmudict import DEFAULT_CMUDICT_PATH
|
|
|
|
|
|
class TestCmuDict:
|
|
|
|
def test_lookup_success(self):
|
|
cmudict = CMUDict(DEFAULT_CMUDICT_PATH)
|
|
arpabet_sequence = cmudict.lookup('word')
|
|
assert arpabet_sequence == ['W ER1 D'] # TODO: Split the phonemes!
|
|
|
|
def test_lookup_failure(self):
|
|
cmudict = CMUDict(DEFAULT_CMUDICT_PATH)
|
|
arpabet_sequence = cmudict.lookup('fakeword')
|
|
assert arpabet_sequence == None
|