Markov chain N-gram model implementation for data and text.