Java code to convert words to their simple form