Understanding the TweetHandler class
The TweetHandler
class holds information about a specific tweet. It takes the raw JSON tweet and extracts those parts that are relevant to the application's needs. It also possesses the methods to process the tweet's text such as converting the text to lowercase and removing tweets that are not relevant. The first part of the class is shown next:
public class TweetHandler { private String jsonText; private String text; private Date date; private String language; private String category; private String userName; ... public TweetHandler processJSON() { ... } public TweetHandler toLowerCase(){ ... } public TweetHandler removeStopWords(){ ... } public boolean isEnglish(){ ... } public boolean containsCharacter(String character) { ... } public void computeStats(){ ... } public void buildSentimentAnalysisModel{ ... } public TweetHandler performSentimentAnalysis(){ ... ...