This project is Homework 2 for the Java Fundamentals course.
Implement the method getWords(filename)
in class Homework2
. Do not change the method signature.
Find five most used words in a file. Treat words in case insensitive manner and skip one-letter words. Implementation must use the stream API and lambdas.
You can use the following snippet to read lines:
Files.lines(Paths.get("lorem-ipsum.txt"))
Additional tips:
- Consider edge cases!
- Add more unit tests
- must work with any file, not only lorem-ipsum.txt
- punctuation matters
- format your code!
Please check the instructions on the jf-hw-intro