pub fn get_term_frequencies_from_word_vector_without_stop_words(
word_tokens: Vec<&str>,
stop_words: Vec<String>
) -> BTreeMap<String, f64>
Expand description
Gets a count of all words from a vector of word_tokens
without stop words.
Examples
use std::collections::BTreeMap;
use rnltk::token;
let arg = vec!["fear", "leads", "to", "anger", "anger", "leads", "to", "hatred", "hatred", "leads", "to", "conflict", "conflict", "leads", "to", "suffering"];
let word_counts = BTreeMap::from([("fear".to_string(), 1.), ("leads".to_string(), 4.), ("anger".to_string(), 2.), ("hatred".to_string(), 2.), ("conflict".to_string(), 2.), ("suffering".to_string(), 1.)]);
let stop_words = token::get_stop_words();
let term_frequencies = token::get_term_frequencies_from_word_vector_without_stop_words(arg, stop_words);
assert_eq!(word_counts, term_frequencies);