Corrcey my Soellign

Python 2.7, 161 159 bytes

from itertools import*
lambda a,k=' qwertyuiop asdfghjkl zxcvbnm ':set(map(''.join,product(*[k[k.index(l)-1:k.index(l)+2].strip()for l in a])))&set("<dictionary>".split())

readable version

from itertools import *
dictionary=set("<dictionary>".split())
keyboard=' qwertyuiop asdfghjkl zxcvbnm '
x=[]
for letter in input():
 index=keyboard.index(letter)
 x.append(keyboard[index-1:index+2].strip())

words=set(map(''.join,product(*x)))
print words&dictionary
  • Saved 1 byte thanks to @TuukkaX

Tags:

Code Golf