pub fn sort_map_to_vec(frequency: HashMap<String, u32>) -> Vec<(String, u32)>
Expand description

Sort words in HashMap<Word, Frequency> according to frequency into Vec<String, u32>.

§Example

use text_analysis::sort_map_to_vec;
use std::collections::HashMap;
let mut words_map = HashMap::new();
words_map.insert("one".to_string(), 1 as u32);
words_map.insert("two".to_string(), 2 as u32);
words_map.insert("three".to_string(), 3 as u32);
let vec_sorted = sort_map_to_vec(words_map);
let expected = vec![("three".to_string(), 3 as u32), ("two".to_string(), 2 as u32), ("one".to_string(), 1 as u32)];
assert_eq!(vec_sorted, expected);