Crates.io | tegen |
lib.rs | tegen |
version | 0.1.4 |
source | src |
created_at | 2022-03-05 06:51:37.044668 |
updated_at | 2022-03-06 06:19:07.616791 |
description | tegen is a Rust library designed to generate text from a given template. |
homepage | https://github.com/vs-123/tegen |
repository | https://github.com/vs-123/tegen |
max_upload_size | |
id | 543884 |
size | 9,656 |
tegen is a Rust library designed to generate fast text from a template. (heavily inspired from liderman's text generator)
use tegen::tegen::TextGenerator;
fn main() {
let tg = TextGenerator::new();
// Generate text from a given template
println!("{}", tg.generate("{Hello|Greetings|Salutations}, {World|Reality}!"));
// You can even nest templates!
println!("{}", tg.generate("{Good {night|morning|evening|day}|Hello|Greetings|Howdy|What's up}, {friend|mate}! {How are you|How's it going}?"));
}
The main goal of this library is to generate text from a given template as fast as possible. Other than that, the other goals of this library are: