Class: Pocketsphinx::Configuration::Grammar
- Defined in:
- lib/pocketsphinx/configuration/grammar.rb
Instance Attribute Summary collapse
-
#grammar ⇒ Object
Returns the value of attribute grammar.
Attributes inherited from Base
#ps_config, #setting_definitions
Instance Method Summary collapse
-
#initialize(*args, &block) ⇒ Grammar
constructor
(grammar_path = nil).
-
#post_init_decoder(decoder) ⇒ Object
Since JSGF strings are not supported in Pocketsphinx configuration (only files), we use the post_init_decoder hook to configure the JSGF.
Methods inherited from Default
Methods inherited from Base
#[], #[]=, #details, #setting_names
Constructor Details
#initialize(*args, &block) ⇒ Grammar
(grammar_path = nil)
6 7 8 9 10 |
# File 'lib/pocketsphinx/configuration/grammar.rb', line 6 def initialize(*args, &block)#(grammar_path = nil) super() @grammar = Pocketsphinx::Grammar::Jsgf.new(*args, &block) end |
Instance Attribute Details
#grammar ⇒ Object
Returns the value of attribute grammar.
4 5 6 |
# File 'lib/pocketsphinx/configuration/grammar.rb', line 4 def grammar @grammar end |
Instance Method Details
#post_init_decoder(decoder) ⇒ Object
Since JSGF strings are not supported in Pocketsphinx configuration (only files), we use the post_init_decoder hook to configure the JSGF
14 15 16 17 |
# File 'lib/pocketsphinx/configuration/grammar.rb', line 14 def post_init_decoder(decoder) decoder.set_jsgf_string(grammar.raw) decoder.set_search end |