Skip to content

adamisntdead/markov-chains

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Markov Chains

An implementation of text based markov chains in Rust.

The main use of this is for the generation of text, and thus is not expandable for other uses. If you do need a more geeric implementation / library, please see the markov or markov-chain crates.

Example

fn main() {
    let tokens = include_str!("../input.txt")
        .split_whitespace()
        .map(|x| String::from(x))
        .collect();

    let cache = create_cache(tokens);
    let text = generate_text(cache, 500);
    println!("{}", text);
}

Please note that this library is not available as a crate as of yet, due to the non generic nature of the library.

This may or may not be changed in the near future.

License

MIT.

About

Markov Chains Implemented in Rust

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages