# circlejerk
A tiny in-memory opinion tracker for measuring group consensus.
`circlejerk` counts repeated opinions and reports whether a group agrees, how
strong the dominant opinion is, and which opinion has the most support.
## Usage
Add the crate to your project:
```toml
[dependencies]
circlejerk = "0.1.1"
```
Record opinions and inspect the result:
```rust
use circlejerk::CircleJerk;
let mut group = CircleJerk::new();
group.agree("Rust is great");
group.agree("Rust is great");
group.agree("Other languages are fine too");
assert_eq!(group.participants(), 3);
assert_eq!(group.dominant_opinion(), Some("Rust is great"));
assert_eq!(group.consensus_ratio(), 2.0 / 3.0);
assert!(!group.consensus());
```
Each call to `agree` counts as one participant. The crate does not track
participant identities. If several opinions tie for the most support,
`dominant_opinion` may return any one of them.
## License
Licensed under the MIT License. See [LICENSE](LICENSE) for details.