Created
May 13, 2011 08:57
-
-
Save floere/970226 to your computer and use it in GitHub Desktop.
Simple example dialogue for James.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'james' | |
# This is a very simple James example for MacRuby. | |
# | |
# James is a voice controlled butler: | |
# http://github.com/floere/james | |
# | |
# Run using: | |
# 1. gem install james | |
# 2. macruby james_very_simple_example.rb | |
# | |
James.dialogue do | |
hear 'What time is it?' => :time | |
state :time do | |
hear ['What time is it?', 'What time is it now?'] => :time | |
into do | |
time = Time.now | |
"It is currently #{time.hour} #{time.min}." | |
end | |
end | |
end | |
James.listen |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment