Index

A B C E F G H I K L M N O P R S T U 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 information by recording it in the appropriate probability distribution of bigramFrequencies.
addSequence(Iterator<String>) - Method in class org.cis1200.MarkovChain
Adds a single post'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 the post and END_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

ChatterBot - Class in org.cis1200
 
ChatterBot(List<List<String>>) - Constructor for class org.cis1200.ChatterBot
 
ChatterBotMain - 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 posts and the column from which they can be extracted.
ChatterBotMain() - Constructor for class org.cis1200.ChatterBotMain
 
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 an int 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

generatePost() - Method in class org.cis1200.ChatterBot
Generates a random post.
generatePost(NumberGenerator) - Method in class org.cis1200.ChatterBot
Generates a single, well-formatted post by following a random walk through the MarkovModel.
generateRandomPosts(int) - Method in class org.cis1200.ChatterBot
Generates a list containing a specified number of randomly generated posts.
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 a Map 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 provided BufferedReader and provides practice with implementing an Iterator.
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.ChatterBotMain
Prints ten generated posts 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 off of 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

parseAndCleanPost(String) - Static method in class org.cis1200.PostParser
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_POSTS - Static variable in class org.cis1200.ChatterBotMain
File to store generated posts
PATH_TO_POSTS - Static variable in class org.cis1200.ChatterBotMain
This is a path to the CSV file containing the posts.
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.
POST_COLUMN - Static variable in class org.cis1200.ChatterBotMain
Column in the PATH_TO_POSTS CSV file to read posts from
PostParser - 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.
PostParser() - Constructor for class org.cis1200.PostParser
 
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
Constructs an empty distribution.
PUNCTUATION_TOKEN - Static variable in class org.cis1200.PostParser
 

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.
rawPostsToTrainingData(List<String>) - Static method in class org.cis1200.PostParser
Applies the parseAndCleanPost to a list of raw input posts, returning each cleaned post 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.PostParser
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.PostParser
 
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

U

URL_REGEX - Static variable in class org.cis1200.PostParser
 

W

WORD_TOKEN - Static variable in class org.cis1200.PostParser
Regular Expressions
writeStringsToFile(List<String>, String, boolean) - Static method in class org.cis1200.FileUtilities
Given a List of Strings, writes them to a file (one String per line in the file).
A B C E F G H I K L M N O P R S T U W 
All Classes and Interfaces|All Packages|Constant Field Values