Class: VaderSentimentRuby::Checker::SpecialIdiomsChecker
- Inherits:
-
Object
- Object
- VaderSentimentRuby::Checker::SpecialIdiomsChecker
- Defined in:
- lib/vader_sentiment_ruby/checker/special_idioms_checker.rb
Overview
Checks text for special idioms
Instance Method Summary collapse
- #call ⇒ Float
-
#initialize(valence, words_and_emoticons, index) ⇒ SpecialIdiomsChecker
constructor
A new instance of SpecialIdiomsChecker.
Constructor Details
#initialize(valence, words_and_emoticons, index) ⇒ SpecialIdiomsChecker
Returns a new instance of SpecialIdiomsChecker.
10 11 12 13 14 |
# File 'lib/vader_sentiment_ruby/checker/special_idioms_checker.rb', line 10 def initialize(valence, words_and_emoticons, index) @valence = valence @words_and_emoticons_lower = words_and_emoticons.map { |word| word.to_s.downcase } @index = index end |
Instance Method Details
#call ⇒ Float
17 18 19 20 21 22 23 24 25 |
# File 'lib/vader_sentiment_ruby/checker/special_idioms_checker.rb', line 17 def call valence = @valence valence = update_valence_checking_preceding_words(valence) valence = update_valence_checking_subsequent_words(valence) update_valence_checking_n_grams(valence) end |