O'Reilly logo

Java for Data Science by Jennifer L. Reese, Richard M. Reese

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required