/// Prints the digram frequency map to the console
Prints the digram frequency map to the console
Prints the digram frequency map to the console
pub fn print_digram_frequencies(map: &HashMap<AsciiUppercaseDigram, usize>) {
    for left in b'A'..=b'Z' {
        for right in b'A'..=b'Z' {
            let left = AsciiUppercaseByte::try_from(left).unwrap();
            let right = AsciiUppercaseByte::try_from(right).unwrap();
            print!("{}{}(", left.get_byte() as char, right.get_byte() as char);
            let key = (left, right);
            match map.get(&key) {
                Some(&count) => { print!("{:2}", count) }
                None => { print!("  ") }
            }
            print!(")  ");
        }
        println!();
    }
}
pub fn print_digram_frequencies ( map : & HashMap < AsciiUppercaseDigram , usize > ) { for left in b'A' ..= b'Z' { for right in b'A' ..= b'Z' { let left = AsciiUppercaseByte :: try_from ( left ) . unwrap ( ) ; let right = AsciiUppercaseByte :: try_from ( right ) . unwrap ( ) ; print ! ( " " left get_byte ( ) as char right get_byte ( ) as char ) ; let key = ( left , right ) ; match map . get ( & key ) { Some ( & count ) => { print ! ( " " count ) } None => { print ! ( " " ) } } print ! ( " " ) ; } println ! ( ) ; } }
Prints the digram frequency map to the console
Prints the digram frequency map to the console
map
&HashMap<AsciiUppercaseDigram, usize>