Permalink
Browse files

+ README

  • Loading branch information...
1 parent 24488a4 commit af4e43158595f8f60fba65d54fe4be27fce25cf1 @floere committed Jun 9, 2011
Showing with 28 additions and 24 deletions.
  1. +28 −24 README.textile
View
@@ -2,30 +2,18 @@ h1. James
A voice controlled electronic butler.
-h2. Requirements
-
-* OSX
-* MacRuby (install rvm, @rvm install macruby@)
-
h2. Installation
-@gem install james@ (OSX only)
-
-h2. Basics
-
-James consists of dialogs that are modeled as state machines. You navigate through these dialogs by talking to James.
-
-He will then take action (looking up timetables, checking the weather etc.) and inform you. Or maybe just tell a joke.
-
-h2. Examples
+@gem install james@ OS X only, MacRuby needed.
+(Install MacRuby using @rvm install macruby@)
-All examples can be found in "/examples":http://github.com/floere/james/tree/master/examples.
+h2. Get James talking!
-Create a file called @time_dialog.rb@:
+Create a file called @time_dialog.rb@. Copy this
<pre><code>James.dialog do
- hear 'what time is it?' => :time
+ hear 'What time is it?' => :time
state :time do
hear ['What time is it?', 'And now?'] => :time
@@ -35,19 +23,35 @@ Create a file called @time_dialog.rb@:
end</code></pre>
-This says that if James hears (@hear@) @"What time is it?"@ that it should enter this conversation into state @:time@.
+into it. Then, in the Terminal, run
+
+<pre><code>$ james time_dialog.rb</code></pre>
-If he then hears @"What time is it?"@ again, it will return to state @:time@.
+And have fun and write your own dialog! :)
+
+h3. What does it do?
+
+The above example says that if James hears (@hear@) @"What time is it?"@ that it should enter this conversation into state @:time@, the only state.
+
+If he then hears @"What time is it?"@ again, or @"And now?"@, it will return to state @:time@.
When he enters (@into@), James executes the block in the dialog's context. Whatever is returned from the block, James will say out lout. Everything else he will just think. (So it's like Sinatra in rendering, just that James renders audio)
Here, he will just say the current time when entering the @:time@ state.
-h3. Running it
+Other examples can be found in "/examples":http://github.com/floere/james/tree/master/examples.
+
+h2. Some info
+
+James consists of dialogs that are modeled as state machines. You navigate through these dialogs by talking to James.
+
+He will then take action (looking up timetables, checking the weather etc.) and inform you. Or maybe just tell a joke.
+
+h2. Running James
Running it is easy. There are multiple options:
-h4. Using the james command
+h3. Using the james command
This is easiest. In the terminal, just call
@@ -67,7 +71,7 @@ Options are: @-si@ (silent input), @-so@ (silent output), @-s@ (both).
for example will use audio for neither input nor output.
-h4. Programmatically
+h3. Programmatically
<pre><code>require 'rubygems'
require 'james'
@@ -88,7 +92,7 @@ Or, without the @James.listen@, use
on the command line.
-h3. Short Version
+h2. Short Version
There is a short, anonymous dialog version, using @James.dialog@.
@@ -105,7 +109,7 @@ end</code></pre>
@James.dialog@ will directly create a dialog instance from your definitions in the block and plug it into James.
-h3. Extended Version
+h2. Extended Version
Or there is an extended version, using initialize with parameters to set up some important stuff that needs other stuff for doing stuff, you know?

0 comments on commit af4e431

Please sign in to comment.