Add check on each key entered

Checks whether the substring entered equals the substring of the current
word, and whether the entered text equals the whole current word.