Index
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 information by recording it in the appropriate probability distribution of
bigramFrequencies
. - addSequence(Iterator<String>) - Method in class org.cis1200.MarkovChain
-
Adds a single tweet's training data to the Markov Chain frequency information, by: recording the first token in
startTokens
recording each subsequent bigram of co-occurring pairs of tokens recording a final bigram of the last token of thetweet
andEND_TOKEN
to mark the end of the sequence
B
- bigramFrequencies - Variable in class org.cis1200.MarkovChain
-
for each token, probability distribution of next token in a sentence
C
- count(T) - Method in class org.cis1200.ProbabilityDistribution
-
Counts the number of occurrences of an element in the ProbabilityDistribution
- CSV - Class in org.cis1200
-
Operations for working with CSV data.
- CSV() - Constructor for class org.cis1200.CSV
- csvFieldsAtColumn(BufferedReader, int) - Static method in class org.cis1200.CSV
-
Given a
BufferedReader
of CSV data and a column index, returns the list of all CSV fields appearing in that column.
E
- END_TOKEN - Static variable in class org.cis1200.MarkovChain
-
end of sentence marker
- extractColumn(String, int) - Static method in class org.cis1200.CSV
-
Given a
String
that represents a CSV line and anint
column index, returns the contents of that column.
F
- fileToReader(String) - Static method in class org.cis1200.FileUtilities
-
Takes in a filename and creates a BufferedReader.
- FileUtilities - Class in org.cis1200
-
This class organizes some static methods for working with File IO.
- FileUtilities() - Constructor for class org.cis1200.FileUtilities
- findWalkChoices(List<String>) - Method in class org.cis1200.MarkovChain
-
Generate a list of numbers such that if it is installed as the number generator for the MarkovChain, and used as an iterator, the tokens returned in sequence will be the list of provided tokens.
G
- generateRandomTweets(int) - Method in class org.cis1200.TwitterBot
-
Generates a list containing a specified number of randomly generated tweets.
- generateTweet() - Method in class org.cis1200.TwitterBot
-
Generates a random tweet.
- generateTweet(NumberGenerator) - Method in class org.cis1200.TwitterBot
-
Generates a single, well-formatted tweet by following a random walk through the MarkovModel.
- get(String) - Method in class org.cis1200.MarkovChain
-
Returns the ProbabilityDistribution for a given token.
- getRandomWalk() - Method in class org.cis1200.MarkovChain
-
Gets a random walk through the Markov Chain.
- getRecords() - Method in class org.cis1200.ProbabilityDistribution
-
Exposes the internal representation of the
ProbabilityDistribution
as aMap
for testing purposes. - getTotal() - Method in class org.cis1200.ProbabilityDistribution
-
Total number of instances that have been added via record().
- getWalk(NumberGenerator) - Method in class org.cis1200.MarkovChain
-
Gets a walk through the Markov Chain that follows the path given by the
NumberGenerator
.
H
- hasNext() - Method in class org.cis1200.LineIterator
-
Returns true if there are lines left to read in the file, and false otherwise.
- hasNext() - Method in class org.cis1200.MarkovChainIterator
-
This method determines whether there is a next token in the Markov Chain based on the current state of the walk.
I
- index(T) - Method in class org.cis1200.ProbabilityDistribution
-
Returns the index of the element such that pick(index) will return the element
K
- keySet() - Method in class org.cis1200.ProbabilityDistribution
L
- LineIterator - Class in org.cis1200
-
LineIterator
provides a useful wrapper around Java's providedBufferedReader
and provides practice with implementing anIterator
. - LineIterator(BufferedReader) - Constructor for class org.cis1200.LineIterator
-
Constructs a
LineIterator
for reader. - LineIterator(String) - Constructor for class org.cis1200.LineIterator
-
Creates a LineIterator from a provided filePath by creating a FileReader and BufferedReader for the file.
- 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.TwitterBotMain
-
Prints ten generated tweets to the console so that 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 token follows another token in a collection of sequences.
- MarkovChain() - Constructor for class org.cis1200.MarkovChain
-
Construct an empty
MarkovChain
that can later be trained. - MarkovChain(List<List<String>>) - Constructor for class org.cis1200.MarkovChain
-
Construct a trained
MarkovChain
from the given list of training data. - MarkovChainIterator - Class in org.cis1200
-
This inner class represents a "walk" through the Markov Chain as an
Iterator
that yields each token encountered during the walk. - MarkovChainIterator(ProbabilityDistribution<String>, Map<String, ProbabilityDistribution<String>>, NumberGenerator) - Constructor for class org.cis1200.MarkovChainIterator
-
Constructs an iterator that follows the path specified by the given
NumberGenerator
.
N
- next() - Method in class org.cis1200.LineIterator
-
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.MarkovChainIterator
- 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 (inclusive) and bound (exclusive).
- NumberGenerator - Interface in org.cis1200
-
This simple interface produces numbers.
O
- org.cis1200 - package org.cis1200
P
- parseAndCleanTweet(String) - Static method in class org.cis1200.TweetParser
-
Converts a string into a list of training tokens by first removing any URLs and then breaking up the string at any whitespace.
- parseRecord(String) - Static method in class org.cis1200.CSV
-
Parses one line of a CSV file as a record of fields separated by commas.
- PATH_TO_OUTPUT_TWEETS - Static variable in class org.cis1200.TwitterBotMain
-
File to store generated tweets
- PATH_TO_TWEETS - Static variable in class org.cis1200.TwitterBotMain
-
This is a path to the CSV file containing the tweets.
- pick(int) - Method in class org.cis1200.ProbabilityDistribution
-
Picks an element out of the Probability Distribution 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> - 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
-
Constructs an empty distribution.
- PUNCTUATION_TOKEN - Static variable in class org.cis1200.TweetParser
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.
- rawTweetsToTrainingData(List<String>) - Static method in class org.cis1200.TweetParser
-
Applies the
parseAndCleanTweet
to a list of raw input tweets, returning each cleaned tweet as a list of tokens to be used as training data. - record(T) - Method in class org.cis1200.ProbabilityDistribution
-
Add an instance to the ProbabilityDistribution.
- removeURLs(String) - Static method in class org.cis1200.TweetParser
-
Given a String, remove all substrings that look like a URL.
S
- startTokens - Variable in class org.cis1200.MarkovChain
-
probability distribution of initial tokens in a sentence
T
- TOKEN - Static variable in class org.cis1200.TweetParser
- toString() - Method in class org.cis1200.ListNumberGenerator
- toString() - Method in class org.cis1200.MarkovChain
-
Use this method to print out markov chains with tokens and probability distributions.
- toString() - Method in class org.cis1200.ProbabilityDistribution
-
Print the probability distribution
- TWEET_COLUMN - Static variable in class org.cis1200.TwitterBotMain
-
Column in the PATH_TO_TWEETS CSV file to read tweets from
- TweetParser - Class in org.cis1200
-
This class provides the method for turning a raw
String
into a sequence of tokens to be used for training the Markov Chain. - TweetParser() - Constructor for class org.cis1200.TweetParser
- TwitterBot - Class in org.cis1200
- TwitterBot(List<List<String>>) - Constructor for class org.cis1200.TwitterBot
- TwitterBotMain - Class in org.cis1200
-
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.
- TwitterBotMain() - Constructor for class org.cis1200.TwitterBotMain
U
- URL_REGEX - Static variable in class org.cis1200.TweetParser
W
- WORD_TOKEN - Static variable in class org.cis1200.TweetParser
-
Regular Expressions
- writeStringsToFile(List<String>, String, boolean) - Static method in class org.cis1200.FileUtilities
-
Given a
List
ofString
s, writes them to a file (oneString
per line in the file).
All Classes and Interfaces|All Packages|Constant Field Values