This is a text simplifier application that is maintainable and encapsulated . A command line menu-driven user interface is launched in the Runner class. Text is entered in the console and replacement text is returned via Console Output. Replaced words will be coloured Red.
Below is a list of classes and their methods.
Class: Runner
METHODS: Main method initialises menuand scannerMethod
Class: ConsoleColourInputOutput
METHODS: scannerMethod initialises Thesaurus.init(); Creates scanner object. Takes user input loops over using overloaded operator == to find matches to getGoogleEquivalent(); if true outputs result.
Class: Menu
METHODS: protected final static void menu(),menu layout, initialised in Runner.java
Class: Thesaurus
METHODS: Init() Method reads input from googleWordFile object. Reads input from mobyThesaurus2Fileobject. Adds words to Treeset and Treemap respectively.
addall() is a private encapsulated method that inherits from WordInterface. addAll() adds words to Map that correspond to Google 1000 words.
getGoogleEquivalent() inherits from WordInterface. Gets Google Equivalent of user input words. Instantiated in ConsoleInputOutput.java
Enum: Console Colour
METHODS: colour() colour object String() return colour
toString() @Overrides Console Colour toString to enable Strings to change colour
valueOf(java.lang.String name)Returns the enum constant of this type with the specified name.
values() Returns an array containing the constants of this enum type, in the order they are declared.
Interface:WordInterface
Interface containing methods inherited by the subclass: Thesaurus METHODS: addAll() getGoogleEquivalent() init()
Interface: EnumInterface
Interface used to denote colour METHODS: public enum ConsoleColour public void String();