Rust library to generate word cloud images from text and images !
```rs 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::Img("assets/alanturing.jpg".tostring()), 60.)); tokens.push((Token::Img("assets/turingstatuebletchley.jpg".tostring()), 80.)); tokens.push((Token::Img("assets/computeremoji.png".tostring()), 40.)); // Generate the word-cloud let wc = WordCloud::new().generate(tokens); // Save it wc.save("sample_cloud.png").unwrap(); } ```