N-Gram Markov Chain
A Markov chain is a stochastic model that describes a sequence of possible events where the probability of each event depends only on the state attained in the previous event(s). This implementation uses n-grams (sequences of n tokens) to predict the next token based on learned patterns from training text.