markov_rs 0.1.2

A simple and fast Markov chain generator in Rust.
Documentation
1
2
3
4
5
6
7
8
9
10
11
use markov_rs::MarkovChain;

fn main() {
    let text = [
        "I", "think", "that", "that", "that", "that", "that", "boy", "wrote", "is", "wrong",
    ];
    let mut model = MarkovChain::from(&text);
    for _ in 0..20 {
        print!("{} ", model.next());
    }
}