Skip to content

ashraf706/word-length

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

##Requirements

  • java 8 and following maven dependencies
  • junit 5, hamcrest and maven-surefire-plugin

##Running the Tests

  • Execute git clone https://github.com/ashraf706/word-length.git to clone the public repository to your local machine.
  • From command line change directory and go to the downloaded word-length directory.
  • To run the test execute mvn test from command line. This should execute all tests in com.candidate.WordLengthTest under test package. Please make sure you have the maven dependencies install in your local maven repository in case you have problem running the tests. You can also execute maven clean install to make sure all the dependencies are in place.

##Assumption I made

  • getLongestWordAndLength in com.candidate.WordLength class returns the longest word and length. In case of multiple longest words the function returns the first longest word and its length.
  • The function replaces '.', ';', ',' etc with white spaces and trim both beginning and end of the sentence.
  • Sentence with only multiple white spaces is considered as invalid string.
  • A word filter is in place to discard word such as 'a', 'and', 'the' ect. Words can be insert/delete from filter as necessary.
  • The implementation followed java 8 recommendation rather than creating and maintaining 'for' loop by myself.
  • Aso commit are not squashed intentionally.
  • The com.candidate.App class is a place holder and does not contribute to the exercise.

About

Word lenght exercise

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages