This is a simple auto correct javascript function based on Bi-gram. It will handle input and find any possible similarity based on threshold. It is a part of a coursework. This work is solely on my own. And because of a previous bad experience on posting code, just a short portion of key codes will be shown.
Core function
The getSimilarLevel function will produce the similarity level between two input words. Basically, it is just to compare and calculate the number of 2-grams that is the same. getTwoGram function is just to generate 2-gram used to compare.