Introduciton
Some of you might have realised that I am a sloppy typer when using my phone. That's why I want you to write a program which corrects my typos.
Chalkrnge
Given a misspelled word, output all of the possible words which I meant to write.
Typso
The main cause of my typos is down to the fact that I hit the wrong keys and often hit the key next door. The following is my keyboard layout:
q w e r t y u i o p
a s d f g h j k l
z x c v b n m
, [ space ] .
Note that the bottom row, , [ space ] .
will never be used in this challenge
For some reason, I only make mistakes horizontally: I would never hit the n instead of the j, but I might hit an f instead of a d.
For example, I could end up spelling the word sloppy as:
akioot
Where I've gone left of each key.
However, don't forget that I may not necessarily make a mistake on every letter in the word.
Ezsmple
Let's say the input is:
vid
The possibilities that the word could have been are:
vid cid bid
vis cis bis
vif cif bif
vod cod bod
vos cos bos
vof cof bof
vud cud bud
vus cus bus
vuf cuf buf
Out of those, the following are in the dictionary:
cod
cud
bid
bud
bus
So that should be your output.
Rulws
You should only use the text file found here as your dictionary: http://mieliestronk.com/corncob_lowercase.txt. You do not have to count this file as part of your byte count.
All input will be a single word. You may display your output in any way you wish (as long as there is some kind of separator).
Assume that with all input, you will find a variant which is in the dictionary.
Wibninf
The shortest code in bytes wins.
""
? \$\endgroup\$