Class: BasicEmotions

Inherits:
Common show all
Defined in:
lib/artemo/basic_emotions.rb

Overview

Note:

This class analyze basic emotions

Returns of expanded basic emotions to complex emotions.

Returns:

  • (Array)

    of expanded basic emotions to complex emotions

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Common

check, scale, weigh

Instance Attribute Details

#keywordsObject (readonly)

Returns the value of attribute keywords.



4
5
6
# File 'lib/artemo/basic_emotions.rb', line 4

def keywords
  @keywords
end

#textObject (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