Permalink
Browse files

Merge branch 'release/0.3.0'

  • Loading branch information...
2 parents 71e79bc + d2c0125 commit 7409247100be6507bd93d8c514f6be7abcc339c1 @benlangfeld benlangfeld committed Sep 22, 2011
View
@@ -5,3 +5,4 @@ pkg/*
spec/reports
.yardoc
doc
+.*.swp
View
@@ -1,3 +1,6 @@
+# 0.3.0
+ * Feature (Taylor Carpenter): Added support for GRXML documents with most elements implemented.
+
# 0.2.2
* Feature: The SSML DSL now supports embedding SSML documents, elements or strings via the `embed` method. This behaves as you might expect:
View
@@ -18,6 +18,7 @@ speak = RubySpeech::SSML.draw do
end
end
end
+
speak.to_s
```
@@ -44,6 +45,66 @@ Once your `Speak` is fully prepared and you're ready to send it off for processi
You may also then need to call `to_s`.
+
+Contruct a GRXML (SGR) document like this:
+
+```ruby
+require 'ruby_speech'
+
+grammy = RubySpeech::GRXML.draw do
+ self.mode = 'dtmf'
+ self.root = 'digits'
+ rule id: 'digits' do
+ one_of do
+ 0.upto(9) {|d| item { d.to_s } }
+ end
+ end
+
+ rule id: 'pin', scope: 'public' do
+ one_of do
+ item do
+ item repeat: '4' do
+ ruleref uri: '#digit'
+ end
+ "#"
+ end
+ item do
+ "* 9"
+ end
+ end
+ end
+end
+
+grammy.to_s
+```
+
+which becomes
+
+```xml
+<grammar xmlns="http://www.w3.org/2001/06/grammar" version="1.0" xml:lang="en-US" mode="dtmf" root="digits">
+ <rule id="digits">
+ <one-of>
+ <item>0</item>
+ <item>1</item>
+ <item>2</item>
+ <item>3</item>
+ <item>4</item>
+ <item>5</item>
+ <item>6</item>
+ <item>7</item>
+ <item>8</item>
+ <item>9</item>
+ </one-of>
+ </rule>
+ <rule id="pin" scope="public">
+ <one-of>
+ <item><item repeat="4"><ruleref uri="#digit"/></item>#</item>
+ <item>* 9</item>
+ </one-of>
+ </rule>
+</grammar>
+```
+
Check out the [YARD documentation](http://rdoc.info/github/benlangfeld/ruby_speech/master/frames) for more
## Features:
@@ -56,6 +117,15 @@ Check out the [YARD documentation](http://rdoc.info/github/benlangfeld/ruby_spee
* `<break/>`
* `<audio/>`
+### GRXML
+* Document construction
+* `<item/>`
+* `<one-of/>`
+* `<rule/>`
+* `<ruleref/>`
+* `<tag/>`
+* `<token/>`
+
## TODO:
### SSML
#### Document Structure
@@ -69,6 +139,11 @@ Check out the [YARD documentation](http://rdoc.info/github/benlangfeld/ruby_spee
* `<mark/>`
* `<desc/>`
+### GRXML
+* `<meta/>` and `<metadata/>`
+* `<example/>`
+* `<lexicon/>`
+
## Links:
* [Source](https://github.com/benlangfeld/ruby_speech)
Oops, something went wrong.

0 comments on commit 7409247

Please sign in to comment.