Package org.cis1200

Class TwitterBotMain

java.lang.Object
org.cis1200.TwitterBotMain

public class TwitterBotMain extends Object
This is the class where everything you've worked on comes together! You can see that we've provided a path to a CSV file of tweets and the column from which they can be extracted. When run as an application, this program builds a Markov Chain from the training data in the CSV file, generates 10 random tweets, and prints them to the terminal.

There is nothing for you to do in this file -- it already contains the code necessary to put your TwitterBot to work.

When run on the data from the illustrative_example.csv, we get output that looks like:

 a table and a banana! and a chair
 a table and a banana! and a banana! and a table and a chair
 a chair
 a chair
 a banana! and a table and a banana! and a banana! and a banana! and a banana! and a banana?
 a table and a banana?
 a banana?
 a table and a chair
 a chair
 a table and a banana! and a table and a chair*
 

When run on more realistic data from factretreiver_tweets.csv, we get witticisms like * the following (among much junkier random outputs): *

  * Octopuses can have belly buttons.
  * Sometimes a seed pods look like.
  * Tigers cannot breathe through their mouth.
  * The average of expensive material is called Chicken Feed.
  * Dogs are more efficient fliers than about his followers!
  * Humans can remember ditching school
 
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) static final String
    File to store generated tweets
    (package private) static final String
    This is a path to the CSV file containing the tweets.
    (package private) static final int
    Column in the PATH_TO_TWEETS CSV file to read tweets from
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    main(String[] args)
    Prints ten generated tweets to the console so that you can see how your bot is performing!

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • PATH_TO_TWEETS

      static final String PATH_TO_TWEETS
      This is a path to the CSV file containing the tweets. The main method below uses the tweets in this file when calling TwitterBot. If you want to run the TwitterBot on the other files we provide, change this path to a different file. (You may need to adjust the TWEET_COLUMN too.)
      See Also:
    • TWEET_COLUMN

      static final int TWEET_COLUMN
      Column in the PATH_TO_TWEETS CSV file to read tweets from
      See Also:
    • PATH_TO_OUTPUT_TWEETS

      static final String PATH_TO_OUTPUT_TWEETS
      File to store generated tweets
      See Also:
  • Constructor Details

    • TwitterBotMain

      public TwitterBotMain()
  • Method Details

    • main

      public static void main(String[] args)
      Prints ten generated tweets to the console so that you can see how your bot is performing!