you can use a *.txt file like this :
abands
abapical
abas
abase
abased
abasedly
abasement
abasements
Each line would be a word, using File.get_line() you will be able to fill a dictionary ( that you will have to define on the beginning) using append(line)
Once you have the dictionary its just a matter of looking for the word in there ( you can sort it by length that will make it easier )