rust-freqdist 0.1.5

An implementation of a Frequency Distribution in Rust
Documentation

Frequency Distribution

Build Status

Implementation of a Frequency Distribution in Rust. Keeps track of how many times an object appears in a larger context (for example, how many times a word appears in a piece of text). The underlying data structure of the Frequency Distribution is a HashMap, so the object that is being counted must be hashable.

Example

use freqdist::FrequencyDistribution;

let mut fdist = FrequencyDistribution::new();

fdist.insert("hello");
fdist.insert("hello");
fdist.insert("goodbye");

assert_eq!(fdist.get(&"hello"), 2);

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.