bugfix for similar_text.js

Fixing similar_text.js based on findings on http://stackoverflow.com/questions/14136349/how-does-similar-text-work

Basically, in some cases the algorithm is not implemented correctly. It shouldn't produce the same result when swapping the input words but it seems to do so.