Merge pull request #1818 from MycroftAI/feature/mimic2-phoenetic-spelling

Use the phonetic_spellings.txt in Mimic2
pull/1013/merge
Michael Nguyen 2018-10-01 12:30:30 -05:00 committed by GitHub
commit b9c4f2d10e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View File

@ -2,3 +2,4 @@ jalepeno: hallipeenyo
ai: A.I.
mycroftai: mycroft A.I.
spotify: spot-ify
corgi: core-gee

View File

@ -279,6 +279,14 @@ class Mimic2(TTS):
create_signal("isSpeaking")
sentence = self._normalized_numbers(sentence)
# Use the phonetic_spelling mechanism from the TTS base class
if self.phonetic_spelling:
for word in re.findall(r"[\w']+", sentence):
if word.lower() in self.spellings:
sentence = sentence.replace(word,
self.spellings[word.lower()])
chunks = sentence_chunker(sentence, self.chunk_size)
for idx, req in enumerate(self._requests(chunks)):
results = req.result().json()