A simple command-line utility written in Rust that counts words in text files, with proper support for CJK characters.
- Properly counts words in text containing CJK characters, ignoring punctuation marks.
- Supports reading from files or stdin (pipe)
- Can process multiple files at once
- Run with no arguments to recursively count every UTF-8 text file in the current directory
cargo install cwccwc filename.txtcwc file1.txt file2.txt file3.txtcwcRecurses into subdirectories, skips hidden entries (e.g. .git) and non-UTF-8
(binary) files, and prints a total.
cat file.txt | cwcOR
echo "Some text to count" | cwccwc -V