Class: SimpleSentiment::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/simple_sentiment/result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(score, tokens, words) ⇒ Result

Returns a new instance of Result.



4
5
6
7
8
9
# File 'lib/simple_sentiment/result.rb', line 4

def initialize( score, tokens, words )
	@score = score
	@comparative = score / tokens.length
	@tokens = tokens
	@words = words
end

Instance Attribute Details

#comparativeObject (readonly)

Returns the value of attribute comparative.



3
4
5
# File 'lib/simple_sentiment/result.rb', line 3

def comparative
  @comparative
end

#scoreObject (readonly)

Returns the value of attribute score.



3
4
5
# File 'lib/simple_sentiment/result.rb', line 3

def score
  @score
end

#tokensObject (readonly)

Returns the value of attribute tokens.



3
4
5
# File 'lib/simple_sentiment/result.rb', line 3

def tokens
  @tokens
end

#wordsObject (readonly)

Returns the value of attribute words.



3
4
5
# File 'lib/simple_sentiment/result.rb', line 3

def words
  @words
end