cased_counts

Function cased_counts 

Source
pub fn cased_counts(text: &str) -> HashMap<char, usize>
Expand description

Returns a frequency map of the given text. The turned map maps characters to the number of times they appear in the given string. To get a frequency map that maps characters to percentages, use frequency::of_cased().

This function treats uppercase and lowercase as different, and the returned map contains mappings for both that are present. Use frequency::counts() to retrieve a map that’s case-insensitive.

§Performance

This is O(n).

§Returns

A map of characters and the number of times they appear in the given string.