To create a ruby-based program to unscramble words
By passing a scrambled word, or sentence, as a parameter the program will rearrange the letter order to reveal the possible combinations and thus the unscrambled word. The program will also make an api request to an online dictionary, in order to retrieve a definition for the possible words. Those words which successfully respond with a definition will be ranked higher on the assumption that those words are more likely to be correct.
-
User inputs scrambled word =>
"cairh"
-
Compute possible combinations =>
['archi', 'chair', 'chari', 'chria', 'richa']
-
Retrieve definitions from an online dictionary, unless there is already a definition in the local dictionary
-
Display possible words with definitions
- chair -> A separate seat for one person, typically with a back and four legs.
- archi -> No definition found - Not in the dictionary
- chari -> No definition found - Not in the dictionary
- chria -> No definition found - Not in the dictionary
- richa -> No definition found - Not in the dictionary
- Unscramble a word
- Unscramble a sentence
- Provide definitions for the unscrambled words
- Sort word combinations from most likely to least likely
- Allow users to add new words to the dictionary
- Allow users to add definitions for their new words
- Allow users to update definitions for existing words
- Display the time taken for the program to unscramble a word
- Clone this repository to your computer
git clone
- Open the repository
- Run
rake run
orruby lib/app.rb
in your terminal (working to transiton from command-line to GUI)