Skip to content
Browse files

Make the default grammar language configurable

  • Loading branch information...
1 parent aae44b2 commit 42f68b1b26361a4f40d45686215d342446057e27 @benlangfeld benlangfeld committed Nov 17, 2012
Showing with 2 additions and 1 deletion.
  1. +1 −1 lib/adhearsion-asr/controller_methods.rb
  2. +1 −0 lib/adhearsion-asr/plugin.rb
View
2 lib/adhearsion-asr/controller_methods.rb
@@ -34,7 +34,7 @@ def listen(opts = {})
grammar_opts = if opts[:grammar_url]
{ url: opts[:grammar_url] }
else
- language = opts.delete(:language) || 'en-us'
+ language = opts.delete(:language) || AdhearsionASR::Plugin.config[:language]
grammar = opts[:grammar]
grammar ||= RubySpeech::GRXML.draw root: 'main', language: language do
rule id: 'main', scope: 'public' do
View
1 lib/adhearsion-asr/plugin.rb
@@ -3,6 +3,7 @@ class Plugin < Adhearsion::Plugin
config :adhearsion_asr do
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 }
+ language 'en-us', desc: 'The default language set on generated grammars. Set nil to use engine default.'
end
end
end

0 comments on commit 42f68b1

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