sindresorhus/leven — pull request #3 by edokan (2014-11-14 09:36:33+00:00)
Title: added support to return similarity of strings

Added asPercentage parameter to return similarity of two given input.

It is useful to see how similar two strings are for some cases.

"abc" and "abd" differs only by one operation. This one operation is %33.3 of the content of the longest string.

"this is some long text to see how much nonsense I can produce" and "this is some long text to see how much nonsense I cam produce" also differs only by one operation. On this case one operation is only %1.7 of the content of the longest string.

I've once used percentages to find a string (comes from ICR) in a predefined list.