/// Creates a dictionary of letter frequency counts for each letter that appears in `text`
Creates a dictionary of letter frequency counts for each letter that appears in `text`
Creates a dictionary of letter frequency counts for each letter that appears in ` text `
pub fn single_letter(text: &[u8]) -> Result<HashMap<AsciiUppercaseByte, usize>, errors::Error> {
    let text = common::sanitize_text(text)?;
    let mut counts = HashMap::new();
    for character in text {
        counts.entry(character)
                .and_modify(|count| { *count += 1 })
                .or_insert(1usize);
    }
    Ok(counts)
}
pub fn single_letter ( text : & [ u8 ] ) -> Result < HashMap < AsciiUppercaseByte , usize > , errors :: Error > { let text = common :: sanitize_text ( text ) ? ; let mut counts = HashMap :: new ( ) ; for character in text { counts . entry ( character ) . and_modify ( | count | { * count += 1 } ) . or_insert ( 1usize ) ; } Ok ( counts ) }
Creates a dictionary of letter frequency counts for each letter that appears in `text`
Creates a dictionary of letter frequency counts for each letter that appears in ` text `
text
&[u8]