Recently, word processors have DWIM features that check for typos and spelling errors as words are typed.
Anticipating variations in the way a user or a programmer expresses themselves has a long history. Before 1984, Warren Teitelman wrote routines to "correct errors automatically or with minor user intervention". Following in the LISP tradition, Emacs has a function
comment-dwim that comments out a selected region if uncommented, or uncomments it, when already commented out.