Crates.io | word-tally |
lib.rs | word-tally |
version | 0.15.0 |
source | src |
created_at | 2024-05-16 19:56:04.361714 |
updated_at | 2024-11-21 19:22:04.31757 |
description | Output a tally of the number of times unique words appear in source input. |
homepage | https://github.com/havenwood/word-tally |
repository | https://github.com/havenwood/word-tally |
max_upload_size | |
id | 1242422 |
size | 65,308 |
Output a tally of the number of times unique words appear in source input.
Usage: word-tally [OPTIONS] [PATH]
Arguments:
[PATH] File path to use as input rather than stdin ("-") [default: -]
Options:
-s, --sort <ORDER> Sort order [default: desc] [possible values: desc, asc, unsorted]
-c, --case <FORMAT> Case normalization [default: lower] [possible values: original, upper, lower]
-m, --min-chars <COUNT> Exclude words containing fewer than min chars
-M, --min-count <COUNT> Exclude words appearing fewer than min times
-e, --exclude <WORDS> Exclude words from a comma-delimited list
-d, --delimiter <VALUE> Delimiter between keys and values [default: " "]
-o, --output <PATH> Write output to file rather than stdout
-v, --verbose Print verbose details
-h, --help Print help
-V, --version Print version
> word-tally README.md | head -n3
tally 22
word 20
https 11
> word-tally --delimiter="," --output="tally.csv" README.md
cargo install word-tally
Add word-tally
as a dependency.
[dependencies]
word-tally = "0.15.0"
Or optionally enable JSON serialization and deserialization with Serde.
[dependencies]
word-tally = { version = "0.15.0", features = ["serde"] }
Clone the repository.
git clone https://github.com/havenwood/word-tally
cd word-tally
Run the tests.
cargo test
Or run the tests with the Serde feature included.
cargo test --features serde
And run the benchmarks.
cargo bench