9 releases

Uses old Rust 2015

0.1.5 Oct 5, 2016
0.1.4 Feb 3, 2016
0.1.3 Jun 24, 2015
0.1.2 Apr 20, 2015
0.0.4 Jan 13, 2015

#947 in Math

Download history 302/week @ 2024-12-17 179/week @ 2024-12-24 600/week @ 2024-12-31 12313/week @ 2025-01-07 17368/week @ 2025-01-14 2268/week @ 2025-01-21 1457/week @ 2025-01-28 1799/week @ 2025-02-04 1764/week @ 2025-02-11 1963/week @ 2025-02-18 2030/week @ 2025-02-25 3093/week @ 2025-03-04 2793/week @ 2025-03-11 3160/week @ 2025-03-18 3572/week @ 2025-03-25 4390/week @ 2025-04-01

14,273 downloads per month
Used in 6 crates (2 directly)

MIT/Apache

13KB
233 lines

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.

No runtime deps