Skip to content
Browse files

Merge branch 'release/1.5.0'

  • Loading branch information...
2 parents 388d6d7 + f9041fd commit 16301152cd6344fe9a21a986aac70a1039e9ac82 @benlangfeld benlangfeld committed Jun 30, 2015
View
3 CHANGELOG.md
@@ -1,5 +1,8 @@
# [develop](https://github.com/adhearsion/adhearsion-asr)
+# [v1.5.0](https://github.com/adhearsion/adhearsion-asr/compare/1.4.0...1.5.0) - [2015-06-30](https://rubygems.org/gems/adhearsion-asr/versions/1.5.0)
+ * Feature: Allow setting recognition sensitivity via configuration
+
# [v1.4.0](https://github.com/adhearsion/adhearsion-asr/compare/1.3.0...1.4.0) - [2015-06-15](https://rubygems.org/gems/adhearsion-asr/versions/1.4.0)
* Feature: Added support for passing a custom render_document to #ask
* Feature: Permit specifying a separate inter-digit timeout with a more useful default
View
1 lib/adhearsion-asr/plugin.rb
@@ -5,6 +5,7 @@ class Plugin < Adhearsion::Plugin
min_confidence 0.5, desc: 'The default minimum confidence level used for all recognizer invocations.', transform: Proc.new { |v| v.to_f }
timeout 5, desc: 'The default timeout (in seconds) used for all recognizer invocations.', transform: Proc.new { |v| v.to_i }
inter_digit_timeout 2, desc: 'The timeout used between DTMF digits and to terminate partial invocations', transform: Proc.new { |v| v.to_i }
+ sensitivity 0.5, desc: 'The sensitivity of speech recognition. Valid values between 0 and 1.', transform: Proc.new { |v| v.to_f }
recognizer nil, desc: 'The default recognizer used for all input. Set nil to use platform default.'
input_language 'en-US', desc: 'The default language set on generated grammars. Set nil to use platform default.'
end
View
1 lib/adhearsion-asr/prompt_builder.rb
@@ -9,6 +9,7 @@ def initialize(output_document, grammars, options)
inter_digit_timeout: timeout(options[:inter_digit_timeout] || Plugin.config.inter_digit_timeout),
max_silence: timeout(options[:timeout] || Plugin.config.timeout),
min_confidence: Plugin.config.min_confidence,
+ sensitivity: Plugin.config.sensitivity,
grammars: grammars,
recognizer: Plugin.config.recognizer,
language: Plugin.config.input_language,
View
2 lib/adhearsion-asr/version.rb
@@ -1,3 +1,3 @@
module AdhearsionASR
- VERSION = "1.4.0"
+ VERSION = "1.5.0"
end
View
17 spec/adhearsion-asr/controller_methods_spec.rb
@@ -64,6 +64,7 @@ def self.temp_config_value(key, value, namespace = Plugin.config)
inter_digit_timeout: 2000,
max_silence: 5000,
min_confidence: 0.5,
+ sensitivity: 0.5,
recognizer: nil,
language: 'en-US',
grammar: { value: expected_grxml }
@@ -382,6 +383,22 @@ def self.temp_config_value(key, value, namespace = Plugin.config)
end
end
+ context "with a different default sensitivity" do
+ let(:expected_grxml) { digit_limit_grammar }
+
+ before do
+ expected_input_options.merge! sensitivity: 0.8
+ end
+
+ temp_config_value :sensitivity, 0.8
+
+ it "executes a Prompt with correct sensitivity" do
+ expect_component_execution expected_prompt
+
+ subject.ask prompts, limit: 5
+ end
+ end
+
context "with a different default recognizer" do
let(:expected_grxml) { digit_limit_grammar }

0 comments on commit 1630115

Please sign in to comment.
Something went wrong with that request. Please try again.