A Rust library to generate word-clouds from text and images!
```rust use std::collections::HashMap; use std::fs; use lazystatic::lazystatic; use regex::Regex; use wordcloud_rs::*;
lazystatic! { static ref RETOKEN: Regex = Regex::new(r"\w+").unwrap(); }
fn tokenize(text: String) -> Vec<(Token, f32)> {
let mut counts: HashMap
fn main() { // Prepare the tokens let text = fs::readtostring("assets/sampletext.txt").unwrap(); let mut tokens = tokenize(text); tokens.push((Token::from("assets/alanturing.jpg"), 15.)); tokens.push((Token::from("assets/turingstatuebletchley.jpg"), 20.)); tokens.push((Token::from("assets/computeremoji.png"), 10.)); // Generate the word-cloud let wc = WordCloud::new().generate(tokens); // Save it wc.save("samplecloud.png").unwrap(); } ```