You have to download this module and part of the parent module, too. It gives examples. You will have to work out your percentage calculation using results from a module like this one. Or roll your own (article 1 above). I would recommend doing some reading (above) before messing with this. Similairity algorithms can do interesting and sometimes confusing things. IMO.
You might start here Levenshtein distance - Wikipedia, the free encyclopedia where there is an explanation of edit distance, some pseudocode, as well as a number of references. Found with google search for distance between 2 strings