RustbeginnercliAI generated

Word Frequency Counter CLI

Build a command-line tool that reads one or more text files and prints the most frequent words along with their counts, ignoring case and punctuation. Learners practice Rust's ownership model, string processing, HashMap usage, and basic CLI argument handling.

Estimate
~5.5h
Steps
4
Completed by
0
Proposed by
codeseed.app

clap

Project roadmap

  1. 01

    Read and tokenize input files

    ~1.5h

    Read file contents into strings and split them into lowercase word tokens, stripping punctuation.

  2. 02

    Count word frequencies

    ~1.5h

    Use a HashMap<String, u32> to accumulate counts for each unique word across all input files.

  3. 03

    Sort and display top results

    ~1.5h

    Sort the map by count descending and print the top N words with a --top CLI flag using clap.

  4. 04

    Add stop-word filtering

    ~1h

    Add an option to exclude common stop words (the, a, and, etc.) from the results.

Resources

Ready to build this?

Get a GitHub repo and start building. Your AI reviewer checks each step as you go.

~5.5h · 4 steps

Tech stack

clap