Index

A C E F G H I K L M N O P R S T W 
All Classes and Interfaces|All Packages|Constant Field Values

A

addBigram(String, String) - Method in class org.cis1200.MarkovChain
Adds a bigram to the Markov Chain dictionary.

C

chain - Variable in class org.cis1200.MarkovChain
for each word, probability distribution of next word in a sentence
cleanWord(String) - Static method in class org.cis1200.TweetParser
Do not modify this method.
count(T) - Method in class org.cis1200.ProbabilityDistribution
Counts the number of occurrences of an element in the ProbabilityDistribution
csvDataToTrainingData(BufferedReader, int) - Static method in class org.cis1200.TweetParser
Given a buffered reader and the column from which to extract the tweet data, computes a training set.
csvDataToTweets(BufferedReader, int) - Static method in class org.cis1200.TweetParser
Given a buffered reader and the column that the tweets are in, use the extractColumn and a FileLineIterator to extract every tweet from the reader.

E

END_TOKEN - Static variable in class org.cis1200.MarkovChain
end of sentence marker
extractColumn(String, int) - Static method in class org.cis1200.TweetParser
Given a String that represents a CSV line extracted from a reader and an int that represents the column of the String that we want to extract from, return the contents of that column from the String.

F

FileLineIterator - Class in org.cis1200
FileLineIterator provides a useful wrapper around Java's provided BufferedReader and provides practice with implementing an Iterator.
FileLineIterator(BufferedReader) - Constructor for class org.cis1200.FileLineIterator
Creates a FileLineIterator for the reader.
FileLineIterator(String) - Constructor for class org.cis1200.FileLineIterator
Creates a FileLineIterator from a provided filePath by creating a FileReader and BufferedReader for the file.
fileToReader(String) - Static method in class org.cis1200.FileLineIterator
Takes in a filename and creates a BufferedReader.
fixDistribution(List<String>) - Method in class org.cis1200.MarkovChain
Modifies all ProbabilityDistributions to output words in the order specified.
fixDistribution(List<String>) - Method in class org.cis1200.TwitterBot
Modifies all MarkovChains to output sentences in the order specified.
fixDistribution(List<String>, boolean) - Method in class org.cis1200.MarkovChain
Modifies all ProbabilityDistributions to output words in the order specified.
fixPunctuation(char) - Method in class org.cis1200.TwitterBot
A helper function to return the numerical index of the punctuation.

G

generateTweet(int) - Method in class org.cis1200.TwitterBot
Generates a tweet of a given number of words by using the populated MarkovChain.
generateTweetChars(int) - Method in class org.cis1200.TwitterBot
Generates a tweet using generateTweet().
generateTweets(int, int) - Method in class org.cis1200.TwitterBot
Generates a series of tweets using generateTweetChars().
get(String) - Method in class org.cis1200.MarkovChain
Returns the ProbabilityDistribution for a given token.
getEntrySet() - Method in class org.cis1200.ProbabilityDistribution
 
getPunctuation() - Static method in class org.cis1200.TweetParser
The clone() function helps us clone the array and return the cloned version
getRecords() - Method in class org.cis1200.ProbabilityDistribution
 
getTotal() - Method in class org.cis1200.ProbabilityDistribution
Total number of instances that have been added via record().

H

hasNext() - Method in class org.cis1200.FileLineIterator
Returns true if there are lines left to read in the file, and false otherwise.
hasNext() - Method in class org.cis1200.MarkovChain
This method should check if there is another word to retrieve from the Markov Chain based on the current word of our walk.

I

index(T) - Method in class org.cis1200.ProbabilityDistribution
Returns the index of the element such that pick(index) will return the element
isPunctuated(String) - Static method in class org.cis1200.TwitterBot
A helper function to determine if a string ends in punctuation.
isPunctuation(String) - Method in class org.cis1200.TwitterBot
Returns true if the passed in string is punctuation.

K

keySet() - Method in class org.cis1200.ProbabilityDistribution
 

L

ListNumberGenerator - Class in org.cis1200
Produces a deterministic sequence of numbers
ListNumberGenerator(int[]) - Constructor for class org.cis1200.ListNumberGenerator
Creates a ListNumberGenerator which generates numbers based off of an array of possible integers.
ListNumberGenerator(List<Integer>) - Constructor for class org.cis1200.ListNumberGenerator
Creates a ListNumberGenerator which generates numbers based off of a list of possible integers.

M

main(String[]) - Static method in class org.cis1200.TwitterBot
Prints ten generated tweets to the console so you can see how your bot is performing!
MarkovChain - Class in org.cis1200
A Markov Chain is a data structure that tracks the frequency with which one value follows another value in sequence.
MarkovChain() - Constructor for class org.cis1200.MarkovChain
No need to write any constructors.
MarkovChain(NumberGenerator) - Constructor for class org.cis1200.MarkovChain
No need to write any constructors.
mc - Variable in class org.cis1200.TwitterBot
The MarkovChain you'll be using to generate tweets

N

next() - Method in class org.cis1200.FileLineIterator
Returns the next line from the file, or throws a NoSuchElementException if there are no more strings left to return (i.e.
next() - Method in class org.cis1200.ListNumberGenerator
Returns the next integer available in the list.
next() - Method in class org.cis1200.MarkovChain
If reset() or reset(String start) was called immediately before this, this method should return the string that was set up by that reset call.
next(int) - Method in class org.cis1200.ListNumberGenerator
Returns the next integer available in the list that is less than the specified bound.
next(int) - Method in interface org.cis1200.NumberGenerator
Generates a number based of off a specified bound.
next(int) - Method in class org.cis1200.RandomNumberGenerator
Grabs another integer from the Random number generator that is between 0 and bound (inclusive).
ng - Variable in class org.cis1200.TwitterBot
RandomNumber generator to pick random numbers
NumberGenerator - Interface in org.cis1200
This simple interface produces numbers.

O

org.cis1200 - package org.cis1200
 

P

parseAndCleanSentence(String) - Static method in class org.cis1200.TweetParser
Splits a String representing a sentence into a sequence of words, filtering out any "bad" words from the sentence.
parseAndCleanTweet(String) - Static method in class org.cis1200.TweetParser
Processes a tweet in to a list of sentences, where each sentence is itself a (non-empty) list of cleaned words.
PATH_TO_OUTPUT_TWEETS - Static variable in class org.cis1200.TwitterBot
File to store generated tweets
PATH_TO_TWEETS - Static variable in class org.cis1200.TwitterBot
This is a path to the CSV file containing the tweets.
pick(int) - Method in class org.cis1200.ProbabilityDistribution
Picks an instance of the ProbabilityDistribution non-randomly according to the provided index.
pick(NumberGenerator) - Method in class org.cis1200.ProbabilityDistribution
Picks an instance of the ProbabilityDistribution according to the provided NumberGenerator.
ProbabilityDistribution<T extends Comparable<T>> - Class in org.cis1200
This class represents a probability distribution over a type T as a map from T values to integers.
ProbabilityDistribution() - Constructor for class org.cis1200.ProbabilityDistribution
 

R

RandomNumberGenerator - Class in org.cis1200
Produces random numbers using Java's Random class
RandomNumberGenerator() - Constructor for class org.cis1200.RandomNumberGenerator
Generates pseudo-random numbers.
RandomNumberGenerator(long) - Constructor for class org.cis1200.RandomNumberGenerator
Generates numbers randomly based off of a specified seed.
randomPunctuation() - Method in class org.cis1200.TwitterBot
A helper function for providing a random punctuation String.
record(T) - Method in class org.cis1200.ProbabilityDistribution
Add an instance to the ProbabilityDistribution.
removeURLs(String) - Static method in class org.cis1200.TweetParser
Do not modify this method
replacePunctuation(String) - Static method in class org.cis1200.TweetParser
Do not modify this method.
reset() - Method in class org.cis1200.MarkovChain
DO NOT EDIT THIS METHOD.
reset(String) - Method in class org.cis1200.MarkovChain
Given a starting String, sets up the Iterator functionality such that: (1) the Markov Chain will begin a walk at start.

S

startWords - Variable in class org.cis1200.MarkovChain
probability distribution of initial words in a sentence

T

toString() - Method in class org.cis1200.MarkovChain
Use this method to print out markov chains with words and probability distributions.
toString() - Method in class org.cis1200.ProbabilityDistribution
Print the probability distribution
train(Iterator<String>) - Method in class org.cis1200.MarkovChain
Adds a sentence's training data to the MarkovChain frequency information.
TWEET_COLUMN - Static variable in class org.cis1200.TwitterBot
Column in the PATH_TO_TWEETS CSV file to read tweets from
TweetParser - Class in org.cis1200
TweetParser.csvDataToTrainingData() takes in a buffered reader that contains tweets and iterates through the reader, one tweet at a time, removing parts of the tweets that would be bad inputs to MarkovChain (for example, a URL).
TweetParser() - Constructor for class org.cis1200.TweetParser
 
tweetSplit(String) - Static method in class org.cis1200.TweetParser
Do not modify this method.
TwitterBot - Class in org.cis1200
This is the class where everything you've worked on thus far comes together! You can see that we've provided a path to a CSV file full of tweets and the column from which they can be extracted.
TwitterBot(BufferedReader, int) - Constructor for class org.cis1200.TwitterBot
Given a column and a buffered reader, initializes the TwitterBot by training the MarkovChain with sentences sourced from the reader.
TwitterBot(BufferedReader, int, NumberGenerator) - Constructor for class org.cis1200.TwitterBot
Given a column and a buffered reader, initializes the TwitterBot by training the MarkovChain with all the sentences obtained as training data from the buffered reader.

W

writeStringsToFile(List<String>, String, boolean) - Method in class org.cis1200.TwitterBot
Given a List of Strings, prints those Strings to a file (one String per line in the file).
writeTweetsToFile(int, int, String, boolean) - Method in class org.cis1200.TwitterBot
Generates tweets and writes them to a file.
A C E F G H I K L M N O P R S T W 
All Classes and Interfaces|All Packages|Constant Field Values