@UmbraSicaro/

SentAnalysis

C++11

No description

fork
loading
Files
  • main.cpp
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <iostream>
#include <vector>
#include <cstring>

// tweetCrawl returns
std::string quoteStart = "The tweet is a quote.";
std::string unexpIssue = "An unexpected error has occured in tweetCrawl function.";

std::string tweet;
std::vector<std::string> sentiWords = {};

int m_PosMax = 7;
std::string m_Positive[] = {"good", "cool", "nice", "happy", "terrific", "positive", "awesome"};
int m_NegMax = 7;
std::string m_Negative[] = {"bad", "terrible", "sad", "tragic", "abysmal", "unfair", "crooked"};
int m_AdjMax = 2;
std::string m_Adjective[] = {"very", "so"};

std::string tweetCrawl( std::string );

int main() {
  std::cin >> tweet; 
  tweetCrawl(tweet);
}

std::string tweetCrawl(std::string twet){
  if (twet[0] == '\"'){
    return quoteStart; // this returns if the string is a quote
  }
  else {
    for (int ctr = 0; ctr < twet.length(); ctr++){
      twet[ctr] = tolower(twet[ctr]);
    }
    std::cout << twet; // this line was supposed to be a check for me to see if the tolower block was working
  }
}