Class: BasicEmotions
Overview
Note:
This class analyze basic emotions
Returns of expanded basic emotions to complex emotions.
Instance Attribute Summary collapse
-
#keywords ⇒ Object
readonly
Returns the value of attribute keywords.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Class Method Summary collapse
Methods inherited from Common
Instance Attribute Details
#keywords ⇒ Object (readonly)
Returns the value of attribute keywords.
4 5 6 |
# File 'lib/artemo/basic_emotions.rb', line 4 def keywords @keywords end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
5 6 7 |
# File 'lib/artemo/basic_emotions.rb', line 5 def text @text end |
Class Method Details
.call(keywords, text) ⇒ Object
Note:
This method initializes class
9 10 11 12 13 14 15 16 17 |
# File 'lib/artemo/basic_emotions.rb', line 9 def self.call(keywords, text) @keywords = keywords @text = text sum_array = compare scaled_array = scale(sum_array) checked_array = check(scaled_array) weighed_array = weigh(scaled_array, checked_array) scale(weighed_array) end |