Create a command line dictionary tool using wordnik api. Check Wordnik DOCS here.
The command line tool should have following functions - The output should be nicely formatted on console, and show all relevant information.
Display definitions of a word.
./dict def <word>
Display synonyms of a word.
./dict syn <word>
Display antonyms of a word
./dic ant <word>
Display examples of a word
./dict ex <word>
Display all above details for a word
./dict <word>
or
./dict dict <word>
Display all above details of word of the day
./dict
./dict play
The program should display a definition, synonym, or antonym and ask the user to enter the word.
If correct word is entered, program should tell that the word is correct (Synonyms of the word should also be accepted as correct answer).
If incorrect word is entered, program should ask for
-
try again
Lets user enter word again
-
hint
Display a hint, and let user enter word again Hint can be
- Display the word randomly jumbled (cat -> atc).
- Display another definition of the word.
- Display another antonym of the word.
- Display another synonym of the word.
-
quit
Display the word, its full dict, and quit
How To Run
- The code is written in NodeJS.
- Pull this repo, and run
npm install, this will install all the dependencies required. - To run the program type
node app. - Now type the any of the aforementioned command.