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 |
#465 in Science
2,007 downloads per month
Used in 6 crates
(2 directly)
13KB
233 lines
Frequency Distribution
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
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
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.