Class: Natter::Intent
- Inherits:
-
Object
- Object
- Natter::Intent
- Defined in:
- lib/natter/intent.rb
Overview
Public: Represents an intent derived by the parser from an utterance.
Instance Attribute Summary collapse
-
#confidence ⇒ Object
How confident the parser is that this is the correct intent (from 0.0 - 1.0).
-
#entities ⇒ Object
An array of entities discovered in the utterance.
-
#name ⇒ Object
The string name of this intent.
-
#skill ⇒ Object
The name of the skill that this intent belongs to.
Instance Method Summary collapse
-
#initialize(name, skill = '', confidence = 1.0, entities = nil) ⇒ Intent
constructor
Public: Constructor.
Constructor Details
#initialize(name, skill = '', confidence = 1.0, entities = nil) ⇒ Intent
Public: Constructor.
name - The String name of this intent. Does not have to be unique. skill - The name of the skill that this intent belongs to. Defaults
to the global namespace/skill (default: '')
confidence - Float value between 0-1 reflects how confident the parser is
that this intent is correct (default: 1.0).
entities - An array of Natter::Entity objects (default: nil).
21 22 23 24 25 26 |
# File 'lib/natter/intent.rb', line 21 def initialize(name, skill = '', confidence = 1.0, entities = nil) @name = name @skill = skill @confidence = confidence @entities = entities || [] end |
Instance Attribute Details
#confidence ⇒ Object
How confident the parser is that this is the correct intent (from 0.0 - 1.0).
9 10 11 |
# File 'lib/natter/intent.rb', line 9 def confidence @confidence end |
#entities ⇒ Object
An array of entities discovered in the utterance. May be empty.
11 12 13 |
# File 'lib/natter/intent.rb', line 11 def entities @entities end |
#name ⇒ Object
The string name of this intent.
5 6 7 |
# File 'lib/natter/intent.rb', line 5 def name @name end |
#skill ⇒ Object
The name of the skill that this intent belongs to.
7 8 9 |
# File 'lib/natter/intent.rb', line 7 def skill @skill end |