Permalink
Browse files

+ changes for the demo at RUG Melbourne

  • Loading branch information...
1 parent 5ac8c7f commit b2d75caa9fc6c21e6fde8fec36aae22363905945 @floere committed Jun 30, 2011
@@ -43,7 +43,8 @@ def initialize
]
end
- hear 'Shake the eight ball' => :shake
+ hear 'Shake the eight ball' => :shake,
+ 'I have a question' => :shake
state :shake do
hear ['Shake the eight ball', 'Again']
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# James.dialog do
+#
+# hear 'Say hello' => :hi
+#
+# state :hi do
+# into { "Hello Ruby User Group Melbourne!" }
+# hear 'Again'
+# end
+#
+# end
@@ -0,0 +1 @@
+Some information regarding how it is implemented.
@@ -0,0 +1,11 @@
+recognizer = NSSpeechRecognizer.alloc.init
+recognizer.setDelegate self
+def speechRecognizer sender, didRecognizeCommand: command
+ puts "I heard the command #{command}!"
+end
+recognizer.setCommands [
+ "Hello, James",
+ "How are you?",
+ "Nice weather, isn't it?"
+]
+recognizer.startListening
@@ -0,0 +1,2 @@
+output = NSSpeechSynthesizer.alloc.initWithVoice 'com.apple.speech.synthesis.voice.Alex'
+output.startSpeakingString 'Hello'
@@ -9,9 +9,9 @@ class CoreDialog
include James::Dialog
- # This core dialog starts at awake.
+ # This core dialog starts at away.
#
- initially :awake
+ initially :away
# The alert state.
# When James is in this state, he should be
@@ -24,6 +24,9 @@ class CoreDialog
chainable
hear "Thank you, James." => :awake,
+ "Thanks for that, James." => :awake,
+ "Thank you." => :awake,
+ "Go back." => :awake,
'I need some time alone, James.' => :away,
"Good night, James." => :exit
into { "Sir?" }
@@ -34,8 +37,9 @@ class CoreDialog
# or the good night, i.e. exit phrase.
#
state :away do
- hear 'James?' => :awake,
- "Good night, James." => :exit
+ hear 'James?' => :awake,
+ 'Are you there, James?' => :awake,
+ "Good night, James." => :exit
into { "Of course, Sir!" }
end

0 comments on commit b2d75ca

Please sign in to comment.