pub fn get_term_frequencies_from_sentence_without_stop_words(
    sentence: &str,
    stop_words: Vec<String>
) -> BTreeMap<String, f64>
Expand description

Gets a count of all words from a sentence without stop_words.

Examples

use std::collections::BTreeMap;
use rnltk::token;
 
let sentence = "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_sentence_without_stop_words(sentence, stop_words);

assert_eq!(word_counts, term_frequencies);