Class: NexosisApi::VocabularyWord
- Inherits:
-
Object
- Object
- NexosisApi::VocabularyWord
- Defined in:
- lib/nexosis_api/vocabulary_word.rb
Overview
parse results of a single word entry in a vocabulary
Instance Attribute Summary collapse
-
#rank ⇒ Integer
readonly
For words the rank or relative importance of the word in predictions.
-
#text ⇒ String
readonly
The actual word or word pair.
-
#type ⇒ String
readonly
Either word or stopWord.
Instance Method Summary collapse
-
#initialize(word_hash) ⇒ VocabularyWord
constructor
A new instance of VocabularyWord.
Constructor Details
#initialize(word_hash) ⇒ VocabularyWord
Returns a new instance of VocabularyWord.
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
#rank ⇒ Integer (readonly)
For words the rank or relative importance of the word in predictions. Nil for stop words.
19 20 21 |
# File 'lib/nexosis_api/vocabulary_word.rb', line 19 def rank @rank end |
#text ⇒ String (readonly)
The actual word or word pair
11 12 13 |
# File 'lib/nexosis_api/vocabulary_word.rb', line 11 def text @text end |
#type ⇒ String (readonly)
Either word or stopWord
15 16 17 |
# File 'lib/nexosis_api/vocabulary_word.rb', line 15 def type @type end |