crawlserv++  [under development]
Application for crawling and analyzing textual content of websites.
crawlservpp::Data::Sentiment Class Reference

Implementation of the VADER sentiment analysis algorithm. More...

#include <Sentiment.hpp>

Construction

 Sentiment (const std::string &dictionaryFile, const std::string &emojiFile)
 Constructor. More...
 

Getters

std::size_t getDictSize () const
 Gets the number of dictionary entries. More...
 
std::size_t getEmojiNum () const
 Gets the number of entries in the emoji dictionary. More...
 

Sentiment Analysis

SentimentScores analyze (const Tokens &tokens)
 Get the sentiment strength in the given sentence. More...
 

Detailed Description

Implementation of the VADER sentiment analysis algorithm.

See:

Hutto, C.J. & Gilbert, E.E. (2014). VADER: A Parsimonious Rule-based Model for Sentiment Analysis of Social Media Text. Eighth International Conference on Weblogs and Social Media (ICWSM-14). Ann Arbor, MI, June 2014.

Warning
For English language only!

Constructor & Destructor Documentation

◆ Sentiment()

crawlservpp::Data::Sentiment::Sentiment ( const std::string &  dictionaryFile,
const std::string &  emojiFile 
)
inline

Constructor.

Creates the dictionaries from the given files.

Parameters
dictionaryFileConstant reference to a string containing the file name of the dictionary to be used.
emojiFileConstant reference to a string containing the file name of the emoji dictionary to be used.

Member Function Documentation

◆ analyze()

SentimentScores crawlservpp::Data::Sentiment::analyze ( const Tokens &  tokens)
inline

Get the sentiment strength in the given sentence.

Parameters
tokensConstant reference to a vector containing the tokens of the sentence.
Returns
Floating point number representing sentiment strength based on input. Positive values are positive valence, negative values are negative valence.

References crawlservpp::Data::SentimentScores::compound, crawlservpp::Data::VaderButFactorAfter, crawlservpp::Data::VaderButFactorBefore, crawlservpp::Data::VaderC_INCR, crawlservpp::Data::VaderDampOne, crawlservpp::Data::VaderDampTwo, crawlservpp::Data::VaderFOne, crawlservpp::Data::VaderN_SCALAR, crawlservpp::Data::VaderNeverFactor, crawlservpp::Data::VaderOne, crawlservpp::Data::VaderThree, crawlservpp::Data::VaderTwo, and crawlservpp::Data::VaderZero.

◆ getDictSize()

std::size_t crawlservpp::Data::Sentiment::getDictSize ( ) const
inline

Gets the number of dictionary entries.

Returns
Number of entries in the dictionary.

◆ getEmojiNum()

std::size_t crawlservpp::Data::Sentiment::getEmojiNum ( ) const
inline

Gets the number of entries in the emoji dictionary.

Returns
Number of emojis in the dictionary.

The documentation for this class was generated from the following file: