6 How to run it
Build it yourself. Read the tutorial is the other way to read this part.
If you start at this part, make your clone as Get the project says, and then run this command. It puts in your clone the files that this part starts from. A file that the project deleted before this part stays, so delete it if git check lists it:
git rm -rq --cached --ignore-unmatch -- :/ && git restore --source 9e37b6eed295 --staged --worktree -- :/just setupA new user of tally does not know which commands to run, or in which order. The README gets a section, "Run it", that says how to run tally, its tests and its report. The code does not change.
Apply the patch to README.md, from the top of the project:
curl -fsSL https://github.com/rahuldave/tally/compare/9e37b6eed29516f62bc176d1eaa66bf4e86683a6...974d653080b0bd7dd06741b60225518cfecc908e.diff | git apply --include=README.mdThe patch adds the section "Run it" to README.md, after the line Count the words in a text.
uv run tally --top 3 data/corpus.txt
just testThe command prints the three most common words of the corpus, and the tests pass. tally is finished.
Check your files against this part. The command prints nothing when they match, and otherwise shows what differs:
git check 974d653080b0If you are stuck, this command puts the files of this part in place of yours. A file that you made yourself stays:
git restore --source 9e37b6eed295 --staged -- :/ && git restore --source 974d653080b0 --staged --worktree -- :/What changed
README.md: the commands that a new user needs first, in the order to run them. 10 lines added. The file.- look at
## Run it
- look at
The patch to README.md
@@ -1,3 +1,13 @@
# tally
Count the words in a text.
+
+## Run it
+
+Make the environment, the corpus and the report first. Then count the words of a file:
+
+ just setup
+ uv run tally data/corpus.txt
+
+`uv run tally --top 10 data/corpus.txt` prints only the ten most common words. `just test` runs the tests, and
+`just report` writes the ten most common words of the corpus to `build/top.txt`.