JavaScript string ranking 0 for no match upto 1 for perfect... "String".score("str"); //=> 0.825