I have a program that needs to compare any given string with a predefined string and determine if an insertion error, deletion error, transposition or substitution error was made. 

For example, if the word **dog** was presented to the user and the user submits **dogs** or **doge**, it should notify the user that an insertion error has been made. 

How do I go about this?