Class: Adhearsion::Rayo::Component::Input
- Inherits:
-
ComponentNode
- Object
- RayoNode
- Adhearsion::Rayo::CommandNode
- ComponentNode
- Adhearsion::Rayo::Component::Input
- Includes:
- HasHeaders
- Defined in:
- lib/adhearsion/rayo/component/input.rb
Defined Under Namespace
Classes: Complete, Grammar, Signal
Constant Summary collapse
- NLSML_NAMESPACE =
'http://www.ietf.org/xml/ns/mrcpv2'
Instance Attribute Summary
Attributes inherited from RayoNode
#client, #connection, #original_component
Instance Method Summary collapse
- #grammar=(other) ⇒ Object
- #grammars=(others) ⇒ Object
- #inherit(xml_node) ⇒ Object
-
#initial_timeout ⇒ Integer
Indicates the amount of time (in milliseconds) preceding input which may expire before a timeout is triggered.
-
#inter_digit_timeout ⇒ Integer
Indicates (in the case of DTMF input) the amount of time (in milliseconds) between input digits which may expire before a timeout is triggered.
-
#language ⇒ String
Language to use for speech recognition.
-
#max_silence ⇒ Integer
The amount of time in milliseconds that an input command will wait until considered that a silence becomes a NO-MATCH.
-
#min_confidence ⇒ Float
Confidence with which to consider a response acceptable.
-
#mode ⇒ Symbol
Mode by which to accept input.
- #rayo_attributes ⇒ Object
- #rayo_children(root) ⇒ Object
-
#recognition_timeout ⇒ Integer
Indicates the amount of time during input that recognition will occur before a timeout is triggered.
-
#recognizer ⇒ String
Recognizer to use for speech recognition.
-
#sensitivity ⇒ Float
Indicates how sensitive the interpreter should be to loud versus quiet input.
-
#terminator ⇒ String
Terminator by which to signal the end of input.
Methods included from HasHeaders
Methods inherited from ComponentNode
#add_event, #complete_event, #complete_event=, #initialize, #register_event_handler, #register_internal_handlers, #response=, #stop!, #stop_action, #trigger_event_handler, #write_action
Methods inherited from Adhearsion::Rayo::CommandNode
#initialize, #response, #response=
Methods inherited from RayoNode
#==, class_from_registration, from_xml, #inspect, register, #source, #to_rayo, #to_xml
Constructor Details
This class inherits a constructor from Adhearsion::Rayo::Component::ComponentNode
Instance Method Details
#grammar=(other) ⇒ Object
55 56 57 |
# File 'lib/adhearsion/rayo/component/input.rb', line 55 def grammar=(other) self.grammars = [other].compact end |
#grammars=(others) ⇒ Object
45 46 47 |
# File 'lib/adhearsion/rayo/component/input.rb', line 45 def grammars=(others) super others.map { |other| Grammar.new(other) } end |
#inherit(xml_node) ⇒ Object
59 60 61 62 63 |
# File 'lib/adhearsion/rayo/component/input.rb', line 59 def inherit(xml_node) grammar_nodes = xml_node.xpath('ns:grammar', ns: self.class.registered_ns) self.grammars = grammar_nodes.to_a.map { |grammar_node| Grammar.from_xml(grammar_node)} super end |
#initial_timeout ⇒ Integer
Returns Indicates the amount of time (in milliseconds) preceding input which may expire before a timeout is triggered.
36 |
# File 'lib/adhearsion/rayo/component/input.rb', line 36 attribute :initial_timeout, Integer |
#inter_digit_timeout ⇒ Integer
Returns Indicates (in the case of DTMF input) the amount of time (in milliseconds) between input digits which may expire before a timeout is triggered.
39 |
# File 'lib/adhearsion/rayo/component/input.rb', line 39 attribute :inter_digit_timeout, Integer |
#language ⇒ String
Returns language to use for speech recognition.
27 |
# File 'lib/adhearsion/rayo/component/input.rb', line 27 attribute :language, String |
#max_silence ⇒ Integer
Returns the amount of time in milliseconds that an input command will wait until considered that a silence becomes a NO-MATCH.
15 |
# File 'lib/adhearsion/rayo/component/input.rb', line 15 attribute :max_silence, Integer |
#min_confidence ⇒ Float
Returns Confidence with which to consider a response acceptable.
18 |
# File 'lib/adhearsion/rayo/component/input.rb', line 18 attribute :min_confidence, Float |
#mode ⇒ Symbol
Returns mode by which to accept input. Can be :voice, :dtmf or :any.
21 |
# File 'lib/adhearsion/rayo/component/input.rb', line 21 attribute :mode, Symbol, default: :dtmf |
#rayo_attributes ⇒ Object
65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/adhearsion/rayo/component/input.rb', line 65 def rayo_attributes { 'max-silence' => max_silence, 'min-confidence' => min_confidence, 'mode' => mode, 'recognizer' => recognizer, 'language' => language, 'terminator' => terminator, 'sensitivity' => sensitivity, 'initial-timeout' => initial_timeout, 'inter-digit-timeout' => inter_digit_timeout, 'recognition-timeout' => recognition_timeout } end |
#rayo_children(root) ⇒ Object
80 81 82 83 84 85 |
# File 'lib/adhearsion/rayo/component/input.rb', line 80 def rayo_children(root) grammars.each do |grammar| grammar.to_rayo(root) end super end |
#recognition_timeout ⇒ Integer
Returns Indicates the amount of time during input that recognition will occur before a timeout is triggered.
42 |
# File 'lib/adhearsion/rayo/component/input.rb', line 42 attribute :recognition_timeout, Integer |
#recognizer ⇒ String
Returns recognizer to use for speech recognition.
24 |
# File 'lib/adhearsion/rayo/component/input.rb', line 24 attribute :recognizer, String |
#sensitivity ⇒ Float
Returns Indicates how sensitive the interpreter should be to loud versus quiet input. Higher values represent greater sensitivity.
33 |
# File 'lib/adhearsion/rayo/component/input.rb', line 33 attribute :sensitivity, Float |
#terminator ⇒ String
Returns terminator by which to signal the end of input.
30 |
# File 'lib/adhearsion/rayo/component/input.rb', line 30 attribute :terminator, String |