Class: VaderSentimentRuby::SentimentPropertiesIdentifier
- Inherits:
-
Object
- Object
- VaderSentimentRuby::SentimentPropertiesIdentifier
- Defined in:
- lib/vader_sentiment_ruby/sentiment_properties_identifier.rb
Overview
Identify sentiment-relevant string-level properties of input text.
Instance Attribute Summary collapse
-
#is_cap_diff ⇒ Object
readonly
Returns the value of attribute is_cap_diff.
-
#words_and_emoticons ⇒ Object
readonly
Returns the value of attribute words_and_emoticons.
Instance Method Summary collapse
-
#initialize(text) ⇒ SentimentPropertiesIdentifier
constructor
A new instance of SentimentPropertiesIdentifier.
Constructor Details
#initialize(text) ⇒ SentimentPropertiesIdentifier
Returns a new instance of SentimentPropertiesIdentifier.
9 10 11 12 13 14 15 |
# File 'lib/vader_sentiment_ruby/sentiment_properties_identifier.rb', line 9 def initialize(text) text = text.to_s.encode('utf-8') unless text.is_a? String @text = text @words_and_emoticons = prepare_words_and_emoticons # Doesn't separate words from adjacent punctuation (keeps emoticons & contractions) @is_cap_diff = text_contains_mixed_cases? end |
Instance Attribute Details
#is_cap_diff ⇒ Object (readonly)
Returns the value of attribute is_cap_diff.
6 7 8 |
# File 'lib/vader_sentiment_ruby/sentiment_properties_identifier.rb', line 6 def is_cap_diff @is_cap_diff end |
#words_and_emoticons ⇒ Object (readonly)
Returns the value of attribute words_and_emoticons.
6 7 8 |
# File 'lib/vader_sentiment_ruby/sentiment_properties_identifier.rb', line 6 def words_and_emoticons @words_and_emoticons end |