def correction(sentence, pos):
word = sentence[pos]<EOL>cands = candidates(word)<EOL>cands = sorted(cands, key=lambda w: P(w, sentence, pos), reverse=True)<EOL>if cands[<NUM_LIT:0>] == word:<EOL><INDENT>return word<EOL><DEDENT>return cands<EOL>
Most probable spelling correction for word.