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

#1124 in Algorithms

Download history 60/week @ 2023-02-10 63/week @ 2023-02-17 17/week @ 2023-02-24 28/week @ 2023-03-03 25/week @ 2023-03-10 22/week @ 2023-03-17 30/week @ 2023-03-24 21/week @ 2023-03-31 29/week @ 2023-04-07 19/week @ 2023-04-14 15/week @ 2023-04-21 43/week @ 2023-04-28 55/week @ 2023-05-05 34/week @ 2023-05-12 29/week @ 2023-05-19 58/week @ 2023-05-26

180 downloads per month
Used in 3 crates (via punkt)

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