This small but smart algorithm allows You to perform intelligent search for the words and phrases in the text. Imagine that You have recognised the text from the image. Usually there are many corrupted characters and it's impossible to find something directly.
For example, You need to find phrase "Try Again", but You have recognised text like " gh try gh 6%^7 hjgasd 7^& dfg!44d T@y GaIN#%hjk in". People are able to find something similar to "Try Again". It's "T@y GaIN". But machine cannot find it. So, this algorithm allows to find such phrases.
Enjoy it!