Crate markov

Source
Expand description

A generic Markov chain for almost any type. In particular, elements of the chain must be Eq, Hash, and Clone.

§Examples

use markov::Chain;

let mut chain = Chain::new();
chain.feed_str("I like cats and I like dogs.");
println!("{}", chain.generate_str());
use markov::Chain;

let mut chain = Chain::new();
chain.feed(vec![1u8, 2, 3, 5]).feed([3u8, 9, 2]);
println!("{:?}", chain.generate());

Structs§

Traits§

  • The definition of all types that can be used in a Chain.

Type Aliases§