From 900a3d8d2f8e96b5cdd20c95c076b42bfdec9d75 Mon Sep 17 00:00:00 2001 From: "Clayton G. Hobbs" Date: Sun, 27 Dec 2015 00:06:48 -0500 Subject: Update language automatically on startup We now have a hash.yaml file which contains a SHA256 hash of sentences.corpus. If this differs from the hash the file calculated when Kaylee sarts, the language is updated and the new hash is stored in hash.yaml. --- recognizer.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'recognizer.py') diff --git a/recognizer.py b/recognizer.py index 038d4cf..bb35480 100755 --- a/recognizer.py +++ b/recognizer.py @@ -32,9 +32,9 @@ class Recognizer(GObject.GObject): cmd = audio_src+' ! audioconvert ! audioresample ! pocketsphinx name=asr ! appsink sync=false' try: self.pipeline=Gst.parse_launch( cmd ) - except Exception, e: - print e.message - print "You may need to install gstreamer1.0-pocketsphinx" + except Exception as e: + print(e.message) + print("You may need to install gstreamer1.0-pocketsphinx") raise e bus = self.pipeline.get_bus() @@ -63,4 +63,4 @@ class Recognizer(GObject.GObject): # If we have a final command, send it for processing command = msg_struct.get_string('hypothesis') if command != '' and msg_struct.get_boolean('final')[1]: - self.emit("finished", command) + self.emit("finished", command) -- cgit 1.4.1