markov 1.1.0

A generic markov chain implementation in Rust.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
extern crate markov;
#[cfg(feature = "graph")]
extern crate petgraph;

#[cfg(feature = "graph")]
fn main() {
    let mut chain = markov::Chain::of_order(2);
    chain.feed(vec!('e', 'r', 't', 'r', 't', 'y', 'r', 't', 'e', 'r', 't', 'y', 't', 'r'));
    let graph = chain.graph();

    println!("{:?}", petgraph::dot::Dot::new(&graph));
}

#[cfg(not(feature = "graph"))]
fn main() {
    println!("graph example must be compiled with graph enabled.")
}