#ifndef SENTIMENT_ANALYZER_HPP #define SENTIMENT_ANALYZER_HPP #include #include #include #include class SentimentAnalyzer { public: SentimentAnalyzer(); /** * @brief Analyzes the sentiment of the given text. * * @param text The input text to analyze. * @return double A score between -1.0 (negative) and 1.0 (positive). */ double analyze(std::string_view text) const; /** * @brief Tokenizes the input text into words. * * @param text The input text. * @return std::vector List of tokens. */ std::vector tokenize(std::string_view text) const; private: std::map lexicon; void loadLexicon(); }; #endif // SENTIMENT_ANALYZER_HPP