Class: Natter::Intent

Inherits:
Object
  • Object
show all
Defined in:
lib/natter/intent.rb

Overview

Public: Represents an intent derived by the parser from an utterance.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#confidenceObject

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

#entitiesObject

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

#nameObject

The string name of this intent.



5
6
7
# File 'lib/natter/intent.rb', line 5

def name
  @name
end

#skillObject

The name of the skill that this intent belongs to.



7
8
9
# File 'lib/natter/intent.rb', line 7

def skill
  @skill
end