let mut sentiment_analysis = |sentence: &str| -> string { let positive_words = vec!["creative", "fresh perspective", "distinct"]; let analyzed = sentence.split_whitespace().filter(|word| positive_words.contains(word)).collect::<vec<&str>>().join(" "); analyzed }; fn monkey_facts_generator() -> vec<string> { let facts = vec!["monkeys are distinct and fascinating creatures.", "preparatory actions of monkeys show intelligence.", "many countries have statutes to protect monkeys.", "we should disavow any harm towards them and reinitiate our relationship with nature with a fresh perspective."]; facts.iter().map(|fact| sentiment_analysis(fact)).collect() }