Index

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

A

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

C

chain - Variable in class org.cis120.MarkovChain
 
cleanWord(String) - Static method in class org.cis120.TweetParser
Do not modify this method.
count(T) - Method in class org.cis120.ProbabilityDistribution
Counts the number of occurrences of an element in the ProbabilityDistribution
csvDataToTrainingData(BufferedReader, int) - Static method in class org.cis120.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.cis120.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

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

G

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

H

hasNext() - Method in class org.cis120.FileLineIterator
Returns true if there are lines left to read in the file, and false otherwise.
hasNext() - Method in class org.cis120.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 - Variable in class org.cis120.ListNumberGenerator
 
index(T) - Method in class org.cis120.ProbabilityDistribution
Returns the index of the element such that pick(index) will return the element
isPunctuated(String) - Static method in class org.cis120.TwitterBot
A helper function to determine if a string ends in punctuation.
isPunctuation(String) - Method in class org.cis120.TwitterBot
Returns true if the passed in string is punctuation.

K

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

L

list - Variable in class org.cis120.ListNumberGenerator
 
ListNumberGenerator - Class in org.cis120
Produces deterministic numbers by iterating repeatedly over a list or array of integers argued in the constructors.
ListNumberGenerator(Integer[]) - Constructor for class org.cis120.ListNumberGenerator
Creates a ListNumberGenerator which generates numbers based off of an array of possible integers.
ListNumberGenerator(List<Integer>) - Constructor for class org.cis120.ListNumberGenerator
Creates a ListNumberGenerator which generates numbers based off of a list of possible integers.

M

main(String[]) - Static method in class org.cis120.TwitterBot
Prints ten generated tweets to the console so you can see how your bot is performing!
MarkovChain - Class in org.cis120
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.cis120.MarkovChain
No need to write any constructors.
MarkovChain(NumberGenerator) - Constructor for class org.cis120.MarkovChain
No need to write any constructors.
mc - Variable in class org.cis120.TwitterBot
 

N

next() - Method in class org.cis120.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.cis120.ListNumberGenerator
Returns the next integer available in the list.
next() - Method in class org.cis120.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.cis120.ListNumberGenerator
Returns the next integer available in the list that is less than the specified bound.
next(int) - Method in interface org.cis120.NumberGenerator
Generates a number based of off a specified bound.
next(int) - Method in class org.cis120.RandomNumberGenerator
Grabs another integer from the Random number generator that is between 0 and bound (inclusive).
ng - Variable in class org.cis120.TwitterBot
 
NumberGenerator - Interface in org.cis120
This simple interface produces numbers.

O

org.cis120 - package org.cis120
 

P

parseAndCleanSentence(String) - Static method in class org.cis120.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.cis120.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.cis120.TwitterBot
 
PATH_TO_TWEETS - Static variable in class org.cis120.TwitterBot
This is a path to the CSV file containing the tweets.
pick(int) - Method in class org.cis120.ProbabilityDistribution
Picks an instance of the ProbabilityDistribution non-randomly according to the provided index.
pick(NumberGenerator) - Method in class org.cis120.ProbabilityDistribution
Picks an instance of the ProbabilityDistribution according to the provided NumberGenerator.
ProbabilityDistribution<T extends Comparable<T>> - Class in org.cis120
This class represents a probability distribution over a type T as a map from T values to integers.
ProbabilityDistribution() - Constructor for class org.cis120.ProbabilityDistribution
 

R

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

S

smallestUpperBound - Variable in class org.cis120.ListNumberGenerator
 
startWords - Variable in class org.cis120.MarkovChain
 

T

toString() - Method in class org.cis120.MarkovChain
Use this method to print out markov chains with words and probability distributions.
toString() - Method in class org.cis120.ProbabilityDistribution
Print the probability distribution
train(Iterator<String>) - Method in class org.cis120.MarkovChain
Adds a sentence's training data to the MarkovChain frequency information.
TWEET_COLUMN - Static variable in class org.cis120.TwitterBot
 
TweetParser - Class in org.cis120
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.cis120.TweetParser
 
tweetSplit(String) - Static method in class org.cis120.TweetParser
Do not modify this method.
TwitterBot - Class in org.cis120
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.cis120.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.cis120.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.cis120.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.cis120.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|All Packages