Class: SimpleSentiment::Result
- Inherits:
-
Object
- Object
- SimpleSentiment::Result
- Defined in:
- lib/simple_sentiment/result.rb
Instance Attribute Summary collapse
-
#comparative ⇒ Object
readonly
Returns the value of attribute comparative.
-
#score ⇒ Object
readonly
Returns the value of attribute score.
-
#tokens ⇒ Object
readonly
Returns the value of attribute tokens.
-
#words ⇒ Object
readonly
Returns the value of attribute words.
Instance Method Summary collapse
-
#initialize(score, tokens, words) ⇒ Result
constructor
A new instance of Result.
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
#comparative ⇒ Object (readonly)
Returns the value of attribute comparative.
3 4 5 |
# File 'lib/simple_sentiment/result.rb', line 3 def comparative @comparative end |
#score ⇒ Object (readonly)
Returns the value of attribute score.
3 4 5 |
# File 'lib/simple_sentiment/result.rb', line 3 def score @score end |
#tokens ⇒ Object (readonly)
Returns the value of attribute tokens.
3 4 5 |
# File 'lib/simple_sentiment/result.rb', line 3 def tokens @tokens end |
#words ⇒ Object (readonly)
Returns the value of attribute words.
3 4 5 |
# File 'lib/simple_sentiment/result.rb', line 3 def words @words end |