entropiter 0.1.0

A no-dep iterator-compatible frequency and entropy calculator
Documentation

Entropiter

Easily calculate the frequency and probability of symbol occurrence in an iterator, and effortlessly calculate the entropy.

Usage

The user of the library chooses whether to use a HashMap or a BTreeMap as a backing store, each with their own tradeoffs as explained in their official documentation.

Example

use std::collections::HashMap;

use entropiter::FrequencyIteratorExt;

fn main() {
    let shannon_entropy = "shannon".chars().shannon::<HashMap<_, _>>().entropy();
    println!("entropy of shannon: {}", shannon_entropy);
}