Class: Pocketsphinx::Configuration::Default

Inherits:
Base
  • Object
show all
Defined in:
lib/pocketsphinx/configuration/default.rb

Direct Known Subclasses

Grammar, KeywordSpotting

Instance Attribute Summary

Attributes inherited from Base

#ps_config, #setting_definitions

Instance Method Summary collapse

Methods inherited from Base

#[], #[]=, #details, #setting_names

Constructor Details

#initializeDefault

Returns a new instance of Default.



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/pocketsphinx/configuration/default.rb', line 4

def initialize
  super

  # Sets default grammar and language model if they are not set explicitly and
  # are present in the default search path.
  API::Pocketsphinx.ps_default_search_args(@ps_config)

  # Treat ps_default_search_args settings as defaults
  changes.each do |details|
    setting_definitions[details[:name]].deflt = details[:value]
  end
end

Instance Method Details

#changesObject

Show details for settings which don’t match Pocketsphinx defaults



18
19
20
# File 'lib/pocketsphinx/configuration/default.rb', line 18

def changes
  details.reject { |d| d[:default] == d[:value] }
end