Explorar el Código

Rename blather.py to kaylee.py

Clara Hobbs hace 8 años
padre
commit
a40bbe25e2
Se han modificado 2 ficheros con 15 adiciones y 15 borrados
  1. 7
    7
      README.md
  2. 8
    8
      kaylee.py

+ 7
- 7
README.md Ver fichero

20
 
20
 
21
 1. Move commands.tmp to ~/.config/kaylee/commands.conf and fill the file with
21
 1. Move commands.tmp to ~/.config/kaylee/commands.conf and fill the file with
22
 sentences and command to run
22
 sentences and command to run
23
-2. Run blather.py.  This will generate ~/.local/share/kaylee/sentences.corpus
23
+2. Run kaylee.py.  This will generate ~/.local/share/kaylee/sentences.corpus
24
 based on sentences in the 'commands' file, then use
24
 based on sentences in the 'commands' file, then use
25
 <http://www.speech.cs.cmu.edu/tools/lmtool.html> to create and save a new
25
 <http://www.speech.cs.cmu.edu/tools/lmtool.html> to create and save a new
26
 language model and dictionary.
26
 language model and dictionary.
27
-    * For GTK UI, run blather.py -i g
27
+    * For GTK UI, run kaylee.py -i g
28
     * To start a UI in 'continuous' listen mode, use the -c flag
28
     * To start a UI in 'continuous' listen mode, use the -c flag
29
     * To use a microphone other than the system default, use the -m flag
29
     * To use a microphone other than the system default, use the -m flag
30
 3. Start talking
30
 3. Start talking
36
 ### Examples
36
 ### Examples
37
 
37
 
38
 * To run Kaylee with the GTK UI and start in continuous listen mode:
38
 * To run Kaylee with the GTK UI and start in continuous listen mode:
39
-`./blather.py -i g -c`
39
+`./kaylee.py -i g -c`
40
 
40
 
41
 * To run Kaylee with no UI and using a USB microphone recognized and device 2:
41
 * To run Kaylee with no UI and using a USB microphone recognized and device 2:
42
-`./blather.py -m 2`
42
+`./kaylee.py -m 2`
43
 
43
 
44
 * To have Kaylee pass the matched sentence to the executed command:
44
 * To have Kaylee pass the matched sentence to the executed command:
45
-`./blather.py -p`
45
+`./kaylee.py -p`
46
 
46
 
47
 **explanation:** if the commands.conf contains:
47
 **explanation:** if the commands.conf contains:
48
 `good morning world: example_command.sh`
48
 `good morning world: example_command.sh`
50
 example_command.sh as `example_command.sh good morning world`
50
 example_command.sh as `example_command.sh good morning world`
51
 
51
 
52
 * To run a command when a valid sentence has been detected:
52
 * To run a command when a valid sentence has been detected:
53
-	`./blather.py --valid-sentence-command=/path/to/command`
53
+	`./kaylee.py --valid-sentence-command=/path/to/command`
54
 	**note:** this can be set in the options.yml file
54
 	**note:** this can be set in the options.yml file
55
 * To run a command when a invalid sentence has been detected:
55
 * To run a command when a invalid sentence has been detected:
56
-	`./blather.py --invalid-sentence-command=/path/to/command`
56
+	`./kaylee.py --invalid-sentence-command=/path/to/command`
57
 	**note:** this can be set in the options.yml file
57
 	**note:** this can be set in the options.yml file
58
 
58
 
59
 ### Finding the Device Number of a USB microphone
59
 ### Finding the Device Number of a USB microphone

blather.py → kaylee.py Ver fichero

19
 from languageupdater import LanguageUpdater
19
 from languageupdater import LanguageUpdater
20
 
20
 
21
 
21
 
22
-class Blather:
22
+class Kaylee:
23
 
23
 
24
     def __init__(self):
24
     def __init__(self):
25
         self.ui = None
25
         self.ui = None
90
                 # Pop off the first item
90
                 # Pop off the first item
91
                 self.history.pop(0)
91
                 self.history.pop(0)
92
 
92
 
93
-            # Open and truncate the blather history file
93
+            # Open and truncate the history file
94
             hfile = open(self.config.history_file, "w")
94
             hfile = open(self.config.history_file, "w")
95
             for line in self.history:
95
             for line in self.history:
96
                 hfile.write(line + "\n")
96
                 hfile.write(line + "\n")
134
         if self.ui:
134
         if self.ui:
135
             self.ui.run()
135
             self.ui.run()
136
         else:
136
         else:
137
-            blather.recognizer.listen()
137
+            self.recognizer.listen()
138
 
138
 
139
     def quit(self):
139
     def quit(self):
140
         sys.exit()
140
         sys.exit()
156
 
156
 
157
     def load_resource(self, string):
157
     def load_resource(self, string):
158
         local_data = os.path.join(os.path.dirname(__file__), 'data')
158
         local_data = os.path.join(os.path.dirname(__file__), 'data')
159
-        paths = ["/usr/share/blather/", "/usr/local/share/blather", local_data]
159
+        paths = ["/usr/share/kaylee/", "/usr/local/share/kaylee", local_data]
160
         for path in paths:
160
         for path in paths:
161
             resource = os.path.join(path, string)
161
             resource = os.path.join(path, string)
162
             if os.path.exists(resource):
162
             if os.path.exists(resource):
166
 
166
 
167
 
167
 
168
 if __name__ == "__main__":
168
 if __name__ == "__main__":
169
-    # Make our blather object
170
-    blather = Blather()
169
+    # Make our kaylee object
170
+    kaylee = Kaylee()
171
     # Init gobject threads
171
     # Init gobject threads
172
     GObject.threads_init()
172
     GObject.threads_init()
173
     # We want a main loop
173
     # We want a main loop
174
     main_loop = GObject.MainLoop()
174
     main_loop = GObject.MainLoop()
175
     # Handle sigint
175
     # Handle sigint
176
     signal.signal(signal.SIGINT, signal.SIG_DFL)
176
     signal.signal(signal.SIGINT, signal.SIG_DFL)
177
-    # Run the blather
178
-    blather.run()
177
+    # Run the kaylee
178
+    kaylee.run()
179
     # Start the main loop
179
     # Start the main loop
180
     try:
180
     try:
181
         main_loop.run()
181
         main_loop.run()

Loading…
Cancelar
Guardar