ruby_speech 2.3.0-java → 2.3.1-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 49c9d49fb76dbc490de3e8fc4622dcb0836332ff
4
- data.tar.gz: dde47c62b7a6ef5911b7395187047e0fb87f326d
3
+ metadata.gz: 2392c6cf73b13b54d94cd854f0b58cf4787356f1
4
+ data.tar.gz: cf5c6d4c8d537416c6389974237b5b965a898d25
5
5
  SHA512:
6
- metadata.gz: 169ac9da33d7d66d972956f71f87abff5957559aa6ceeee8473a6427c89d0465937146b728cfe353789db113de3f1b36d826b2aaf408c0bbb22aaf37c56e15ad
7
- data.tar.gz: 4d12ad1b5ebddbc881d951005b9529ac37ab6959544e32ee0f2e6c397cee1e65440ade9c9f4be9f92852351fd48f700ce326e00f34009717cb57c3396f0d85a8
6
+ metadata.gz: 7aeeeeb1b5bf64c26f936f29e2df02b4c9198340efa535dd403429aaabbc753a98c03bc27178c4f3e58dab13affd13456d5064b7562549b7e48dba3a185213a2
7
+ data.tar.gz: ade7291fd515e30ea1ca77d76a6fc59878687a6c985e724a2b00add1b8cfeebf4cf897a6eadb057c05b464138f7d0504060faca40d327b2e4c382540a448eb17
data/.travis.yml CHANGED
@@ -3,6 +3,7 @@ language: ruby
3
3
  rvm:
4
4
  - 1.9.3
5
5
  - 2.0.0
6
+ - 2.1.0
6
7
  - jruby-19mode
7
8
  - rbx-19mode
8
9
  - ruby-head
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # [develop](https://github.com/benlangfeld/ruby_speech)
2
2
 
3
+ # [2.3.1](https://github.com/benlangfeld/ruby_speech/compare/v2.3.0...v2.3.1) - [2014-02-24](https://rubygems.org/gems/ruby_speech/versions/2.3.1)
4
+ * Bugfix: Phone number grammar should only allow a single instance of '*'/'x'
5
+ * Bugfix: Concatenating documents containing strings across the border inserts appropriate spacing (#21).
6
+
3
7
  # [2.3.0](https://github.com/benlangfeld/ruby_speech/compare/v2.2.2...v2.3.0) - [2013-09-30](https://rubygems.org/gems/ruby_speech/versions/2.3.0)
4
8
  * Feature: Allow generation of a boolean, date, digits, currency, number, phone or time grammar including from URIs
5
9
  * Bugfix: Ensure that rule refs can be reused when inlining grammars
@@ -105,12 +105,16 @@ module RubySpeech
105
105
  new_doc = Nokogiri::XML::Document.new
106
106
  self.class.new(new_doc).tap do |new_element|
107
107
  new_doc.root = new_element.node
108
+ string_types = [String, Nokogiri::XML::Text]
109
+ include_spacing = string_types.include?(self.nokogiri_children.last.class) && string_types.include?(other.nokogiri_children.first.class)
108
110
  if Nokogiri.jruby?
109
111
  new_element.add_child self.clone.nokogiri_children
112
+ new_element << " " if include_spacing
110
113
  new_element.add_child other.clone.nokogiri_children
111
114
  else
112
115
  # TODO: This is yucky because it requires serialization
113
116
  new_element.add_child self.nokogiri_children.to_xml
117
+ new_element << " " if include_spacing
114
118
  new_element.add_child other.nokogiri_children.to_xml
115
119
  end
116
120
  end
@@ -146,12 +146,21 @@ module RubySpeech::GRXML::Builtins
146
146
  RubySpeech::GRXML.draw mode: :dtmf, root: 'number' do
147
147
  rule id: 'number', scope: 'public' do
148
148
  item repeat: '1-' do
149
- one_of do
150
- 0.upto(9) { |d| item { d.to_s } }
151
- item { '*' }
149
+ ruleref uri: '#digit'
150
+ end
151
+ item repeat: '0-1' do
152
+ item { '*' }
153
+ item repeat: '0-' do
154
+ ruleref uri: '#digit'
152
155
  end
153
156
  end
154
157
  end
158
+
159
+ rule id: 'digit' do
160
+ one_of do
161
+ 0.upto(9) { |d| item { d.to_s } }
162
+ end
163
+ end
155
164
  end
156
165
  end
157
166
 
@@ -1,3 +1,3 @@
1
1
  module RubySpeech
2
- VERSION = "2.3.0"
2
+ VERSION = "2.3.1"
3
3
  end
@@ -143,11 +143,11 @@ describe RubySpeech::GRXML::Builtins do
143
143
  it { should match('0').and_interpret_as('dtmf-0') }
144
144
  it { should match('0123').and_interpret_as('dtmf-0 dtmf-1 dtmf-2 dtmf-3') }
145
145
  it { should match('0123*456').and_interpret_as('dtmf-0 dtmf-1 dtmf-2 dtmf-3 dtmf-star dtmf-4 dtmf-5 dtmf-6') }
146
- it { should match('0123*456*789').and_interpret_as('dtmf-0 dtmf-1 dtmf-2 dtmf-3 dtmf-star dtmf-4 dtmf-5 dtmf-6 dtmf-star dtmf-7 dtmf-8 dtmf-9') }
147
146
 
148
147
  it { should potentially_match('') }
149
148
 
150
149
  it { should not_match('#') }
150
+ it { should not_match('0123*456*789') }
151
151
  end
152
152
 
153
153
  describe "time" do
@@ -182,6 +182,27 @@ module RubySpeech
182
182
  concat.document.root.should == concat
183
183
  concat.to_s.should_not include('default')
184
184
  end
185
+
186
+ context "when concatenating" do
187
+ describe "simple strings" do
188
+ it "inserts a space between them" do
189
+ speak1 = SSML.draw do
190
+ string "Hi, my name"
191
+ end
192
+
193
+ speak2 = SSML.draw do
194
+ string "is Frank"
195
+ end
196
+
197
+ expected_concat = SSML.draw do
198
+ string "Hi, my name is Frank"
199
+ end
200
+
201
+ concat = (speak1 + speak2)
202
+ concat.should == expected_concat
203
+ end
204
+ end
205
+ end
185
206
  end # Speak
186
207
  end # SSML
187
208
  end # RubySpeech
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_speech
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.3.1
5
5
  platform: java
6
6
  authors:
7
7
  - Ben Langfeld
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-30 00:00:00.000000000 Z
11
+ date: 2014-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -316,7 +316,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
316
316
  version: '0'
317
317
  requirements: []
318
318
  rubyforge_project: ruby_speech
319
- rubygems_version: 2.0.7
319
+ rubygems_version: 2.1.9
320
320
  signing_key:
321
321
  specification_version: 4
322
322
  summary: A Ruby library for TTS & ASR document preparation