Skip to content

A simple command line application to list occurrences of different words in a file ordered by frequency (highest first).

Notifications You must be signed in to change notification settings

dfht/WordCounter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WordCounter

A simple command line application to compute the occurrences of different words in a file and output the results to System.out. Each line shows a word and the number of occurrences of that word in the file. The results are printed out in descending order of frequency.

Assuming you have Maven installed, then it can be built (from command line in the project folder) via:

mvn package

This will also run the tests of course.

This will build a combined wordCounter.jar file in the project lib folder. I currently commit this as the latest 'release'. This is an executable java file that can simply be run (from a folder containing the jar of course) via:

java -jar wordCounter.jar

Optionally, arguments can be passed in for the file and the encoding. If the encoding isn't specified then it is 'guessed' from the BOM (via icu4j). If the file isn't specified, then it will be asked for on the command line.

Full usage is:

java -jar wordCounter.jar [-help] [-file=filePath] [-encoding=encoding]

Again, assuming you have Maven installed, you can just run the tests via:

mvn test

(from command line in the project folder).

About

A simple command line application to list occurrences of different words in a file ordered by frequency (highest first).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages