The file mchain.py is a library to create markov chains and use them to generate sentences. the included .txt file "extext.txt" is an example text file made up of the introduciton from the Wikipedia article for books.
The functions included in this file are: (1) portText, (2) getMat, (3) genSent, (4) expMat, (5) portMat
(1) "Import text file" returns a of the words in the text file in order.
portText(filename)
filename -
(2) "Get probability matrix" returns a of the vocabulary &
of words reference text
(3) "Generate sentence" returns a of vocabulary words
mat -
(4) "Export matrix" creates a file storing the information for the matrix generated by the getMat function.
expMat(name,voc,mat)
name - of vocabulary words
mat -
(5) "Import matrix" returns a a of vocabulary &