summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
Diffstat (limited to 'client')
-rw-r--r--client/dictionary_persona.dic22
-rw-r--r--client/languagemodel_persona.lm97
-rw-r--r--client/populate.py7
-rw-r--r--client/stt.py5
4 files changed, 8 insertions, 123 deletions
diff --git a/client/dictionary_persona.dic b/client/dictionary_persona.dic
deleted file mode 100644
index 8b813ac..0000000
--- a/client/dictionary_persona.dic
+++ /dev/null
@@ -1,22 +0,0 @@
-BE B IY
-BEING B IY IH NG
-BUT B AH T
-DID D IH D
-FIRST F ER S T
-IN IH N
-IS IH Z
-IT IH T
-JASPER JH AE S P ER
-NOW N AW
-OF AH V
-ON AA N
-ON(2) AO N
-RIGHT R AY T
-SAY S EY
-WHAT W AH T
-WHAT(2) HH W AH T
-WHICH W IH CH
-WHICH(2) HH W IH CH
-WITH W IH DH
-WITH(2) W IH TH
-WORK W ER K \ No newline at end of file
diff --git a/client/languagemodel_persona.lm b/client/languagemodel_persona.lm
deleted file mode 100644
index f290a31..0000000
--- a/client/languagemodel_persona.lm
+++ /dev/null
@@ -1,97 +0,0 @@
-Language model created by QuickLM on Wed Sep 4 14:21:33 EDT 2013
-Copyright (c) 1996-2010 Carnegie Mellon University and Alexander I. Rudnicky
-
-The model is in standard ARPA format, designed by Doug Paul while he was at MITRE.
-
-The code that was used to produce this language model is available in Open Source.
-Please visit http://www.speech.cs.cmu.edu/tools/ for more information
-
-The (fixed) discount mass is 0.5. The backoffs are computed using the ratio method.
-This model based on a corpus of 18 sentences and 20 words
-
-\data\
-ngram 1=20
-ngram 2=36
-ngram 3=18
-
-\1-grams:
--0.7782 </s> -0.3010
--0.7782 <s> -0.2218
--2.0334 BE -0.2218
--2.0334 BEING -0.2218
--2.0334 BUT -0.2218
--2.0334 DID -0.2218
--2.0334 FIRST -0.2218
--2.0334 IN -0.2218
--2.0334 IS -0.2218
--2.0334 IT -0.2218
--2.0334 JASPER -0.2218
--2.0334 NOW -0.2218
--2.0334 OF -0.2218
--2.0334 ON -0.2218
--2.0334 RIGHT -0.2218
--2.0334 SAY -0.2218
--2.0334 WHAT -0.2218
--2.0334 WHICH -0.2218
--2.0334 WITH -0.2218
--2.0334 WORK -0.2218
-
-\2-grams:
--1.5563 <s> BE 0.0000
--1.5563 <s> BEING 0.0000
--1.5563 <s> BUT 0.0000
--1.5563 <s> DID 0.0000
--1.5563 <s> FIRST 0.0000
--1.5563 <s> IN 0.0000
--1.5563 <s> IS 0.0000
--1.5563 <s> IT 0.0000
--1.5563 <s> JASPER 0.0000
--1.5563 <s> NOW 0.0000
--1.5563 <s> OF 0.0000
--1.5563 <s> ON 0.0000
--1.5563 <s> RIGHT 0.0000
--1.5563 <s> SAY 0.0000
--1.5563 <s> WHAT 0.0000
--1.5563 <s> WHICH 0.0000
--1.5563 <s> WITH 0.0000
--1.5563 <s> WORK 0.0000
--0.3010 BE </s> -0.3010
--0.3010 BEING </s> -0.3010
--0.3010 BUT </s> -0.3010
--0.3010 DID </s> -0.3010
--0.3010 FIRST </s> -0.3010
--0.3010 IN </s> -0.3010
--0.3010 IS </s> -0.3010
--0.3010 IT </s> -0.3010
--0.3010 JASPER </s> -0.3010
--0.3010 NOW </s> -0.3010
--0.3010 OF </s> -0.3010
--0.3010 ON </s> -0.3010
--0.3010 RIGHT </s> -0.3010
--0.3010 SAY </s> -0.3010
--0.3010 WHAT </s> -0.3010
--0.3010 WHICH </s> -0.3010
--0.3010 WITH </s> -0.3010
--0.3010 WORK </s> -0.3010
-
-\3-grams:
--0.3010 <s> BE </s>
--0.3010 <s> BEING </s>
--0.3010 <s> BUT </s>
--0.3010 <s> DID </s>
--0.3010 <s> FIRST </s>
--0.3010 <s> IN </s>
--0.3010 <s> IS </s>
--0.3010 <s> IT </s>
--0.3010 <s> JASPER </s>
--0.3010 <s> NOW </s>
--0.3010 <s> OF </s>
--0.3010 <s> ON </s>
--0.3010 <s> RIGHT </s>
--0.3010 <s> SAY </s>
--0.3010 <s> WHAT </s>
--0.3010 <s> WHICH </s>
--0.3010 <s> WITH </s>
--0.3010 <s> WORK </s>
-
-\end\ \ No newline at end of file
diff --git a/client/populate.py b/client/populate.py
index d1cbb80..e871f26 100644
--- a/client/populate.py
+++ b/client/populate.py
@@ -1,10 +1,11 @@
# -*- coding: utf-8-*-
+import os
import re
from getpass import getpass
import yaml
from pytz import timezone
import feedparser
-
+import jasperpath
def run():
profile = {}
@@ -105,7 +106,9 @@ def run():
# write to profile
print("Writing to profile...")
- outputFile = open("profile.yml", "w")
+ if not os.path.exists(jasperpath.CONFIG_PATH):
+ os.makedirs(jasperpath.CONFIG_PATH)
+ outputFile = open(jasperpath.config("profile.yml"), "w")
yaml.dump(profile, outputFile, default_flow_style=False)
print("Done.")
diff --git a/client/stt.py b/client/stt.py
index b4cc038..c5caf99 100644
--- a/client/stt.py
+++ b/client/stt.py
@@ -10,6 +10,7 @@ import logging
from abc import ABCMeta, abstractmethod
import requests
import yaml
+import jasperpath
"""
The default Speech-to-Text implementation which relies on PocketSphinx.
@@ -42,8 +43,8 @@ class PocketSphinxSTT(AbstractSTTEngine):
SLUG = 'sphinx'
- def __init__(self, lmd="languagemodel.lm", dictd="dictionary.dic",
- lmd_persona="languagemodel_persona.lm", dictd_persona="dictionary_persona.dic",
+ def __init__(self, lmd=jasperpath.config("languagemodel.lm"), dictd=jasperpath.config("dictionary.dic"),
+ lmd_persona=jasperpath.data("languagemodel_persona.lm"), dictd_persona=jasperpath.data("dictionary_persona.dic"),
lmd_music=None, dictd_music=None,
hmm_dir="/usr/local/share/pocketsphinx/model/hmm/en_US/hub4wsj_sc_8k"):
"""