I haven't read all his work, but I guess Shakespeare didn't use "hangn" and "hangin" as an alternative to "hanging".
The author could validate the words against a dictionary, but it would still be flawed due to conjugations being counted as different words.