code: def correction(sentence, pos):
      "Most probable spelling correction for word."
      word = sentence[pos]
      cands = candidates(word)
      if not cands:
          cands = candidates(word, False)
      if not cands:
          return word
      cands = sorted(cands, key=lambda w: P(w, sentence, pos), reverse=True)
      cands = [c[0] for c in cands]
      return candf correction(sentence, pos):
      "Most probable spelling correction for word."
      word = sentence[pos]
      cands = candidates(word)
      if not cands:
          cands = candidates(word, False)
      if not cands:
          return word
      cands = sorted(cands, key=lambda w: P(w, sentence, pos), reverse=True)
      cands = [c[0] for c in cands]
      return cands
docs: Most probable spelling correction for word.