Crates.io | markovish |
lib.rs | markovish |
version | 0.2.1 |
source | src |
created_at | 2024-02-24 22:11:10.75341 |
updated_at | 2024-10-07 19:19:08.396474 |
description | Simple Markov chain implementation for text generation |
homepage | |
repository | https://github.com/ginger51011/markovish/ |
max_upload_size | |
id | 1151954 |
size | 61,255 |
Super simple (and fast) Markov chains in Rust.
use markovish::Chain;
let fortune = r#"
This is a test of the Emergency Broadcast System. If this had been an
actual emergency, do you really think we'd stick around to tell you?
"#;
let chain = Chain::from_text(fortune).unwrap();
let new_fortune = chain.generate_str(&mut rand::thread_rng(), 300);
This project is mostly for my personal use in pandoras_pot
, but PRs
and issues are welcome.
This crate is aimed to be very simple, and the current aim is to do the following well:
More information about usage and the like can be found in the crate docs and in the examples.
If you want to save a chain, you can enable the serde
feature and serialize it.
I do not accept any donations. If you however find any software I
write for fun useful, please consider donating to an efficient charity that
save or improve lives the most per $CURRENCY
.
GiveWell.org is an excellent website that can help you donate to the world's most efficient charities. Alternatives listing the current best charities for helping our planet is Founders Pledge, and for animal welfare Animal Charity Evaluators.
This list is not exhaustive; your country may have an equivalent.