Skip to content

Commit

Permalink
Merge pull request #287 from Wolfgange3311999/master
Browse files Browse the repository at this point in the history
Moved generated dicts to temporary directory
  • Loading branch information
MatthewScholefield committed Jul 14, 2016
2 parents c08cf8b + da804d3 commit f846b83
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,3 @@ mycroft/__version__.py
MANIFEST.in
setup.py
logs/*
mycroft/client/speech/model/*/*.dict
5 changes: 4 additions & 1 deletion mycroft/client/speech/local_recognizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import os
from pocketsphinx.pocketsphinx import Decoder
import tempfile

__author__ = 'seanfitz, jdorleans'

Expand All @@ -38,7 +39,9 @@ def __init__(self, key_phrase, phonemes, threshold, sample_rate=16000,
self.decoder = Decoder(self.create_config(dict_name))

def create_dict(self, key_phrase, phonemes):
folder = os.path.join(BASEDIR, 'model', self.lang)
folder = os.path.join(tempfile.gettempdir(), 'mycroft')
if not os.path.exists(folder):
os.makedirs(folder)
file_name = os.path.join(folder, key_phrase + ".dict")
words = key_phrase.split()
phoneme_groups = phonemes.split('.')
Expand Down

0 comments on commit f846b83

Please sign in to comment.