Class: NexosisApi::VocabularyWord

Inherits:
Object
  • Object
show all
Defined in:
lib/nexosis_api/vocabulary_word.rb

Overview

parse results of a single word entry in a vocabulary

Since:

  • 2.2.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(word_hash) ⇒ VocabularyWord

Returns a new instance of VocabularyWord.

Since:

  • 2.2.0



5
6
7
# File 'lib/nexosis_api/vocabulary_word.rb', line 5

def initialize(word_hash)
  word_hash.each { |k, v| instance_variable_set("@#{k}", v) }
end

Instance Attribute Details

#rankInteger (readonly)

For words the rank or relative importance of the word in predictions. Nil for stop words.

Returns:

  • (Integer)

Since:

  • 2.2.0



19
20
21
# File 'lib/nexosis_api/vocabulary_word.rb', line 19

def rank
  @rank
end

#textString (readonly)

The actual word or word pair

Returns:

  • (String)

Since:

  • 2.2.0



11
12
13
# File 'lib/nexosis_api/vocabulary_word.rb', line 11

def text
  @text
end

#typeString (readonly)

Either word or stopWord

Returns:

  • (String)

Since:

  • 2.2.0



15
16
17
# File 'lib/nexosis_api/vocabulary_word.rb', line 15

def type
  @type
end