Class: Pocketsphinx::Configuration::KeywordSpotting

Inherits:
Default
  • Object
show all
Defined in:
lib/pocketsphinx/configuration/keyword_spotting.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#ps_config, #setting_definitions

Instance Method Summary collapse

Methods inherited from Default

#changes

Methods inherited from Base

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

Constructor Details

#initialize(keyword, threshold = nil) ⇒ KeywordSpotting

Returns a new instance of KeywordSpotting.



6
7
8
9
10
11
12
# File 'lib/pocketsphinx/configuration/keyword_spotting.rb', line 6

def initialize(keyword, threshold = nil)
  super()

  self['lm'] = nil
  self.keyword = keyword
  self.kws_threshold = threshold if threshold
end

Instance Attribute Details

#kws_thresholdObject

Returns the value of attribute kws_threshold.



4
5
6
# File 'lib/pocketsphinx/configuration/keyword_spotting.rb', line 4

def kws_threshold
  @kws_threshold
end

Instance Method Details

#keywordObject



14
15
16
# File 'lib/pocketsphinx/configuration/keyword_spotting.rb', line 14

def keyword
  self['keyphrase']
end

#keyword=(value) ⇒ Object



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

def keyword=(value)
  self['keyphrase'] = sanitize_keyword value
end

#recognition_algorithmObject

See SpeechRecognizer#algorithm



31
32
33
# File 'lib/pocketsphinx/configuration/keyword_spotting.rb', line 31

def recognition_algorithm
  :continuous
end