tumakha / top-20-words

Print 20 most frequently used words in the file (Technical test)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

top-20-words (Technical test)

Java-Gradle-CI

Given the attached text file as an argument, your program will read the file, and output the 20 most frequently used words in the file in order, along with their frequency. The output should be the same to that of the following bash script ./top20words.sh, where the first argument is the text file to count:

Requirements

Java 14+, Gradle 6 or gradle-wrapper

Build

gradle build

Run

java -jar build/libs/top20words.jar <filename>

For example

java -jar build/libs/top20words.jar data/mobydick.txt

Compare with bash script output

./top20words.sh data/mobydick.txt

About

Print 20 most frequently used words in the file (Technical test)


Languages

Language:Java 82.8%Language:Kotlin 14.8%Language:Shell 2.4%