On 8/27/11 11:06 AM, Emile van Sebille wrote:
> from difflib import SequenceMatcher as SM
> 
> def ignore(x):
>     return x in ' ,.'
> 
> for filename in filenames:
>     ratios = [SM(ignore,filename,username).ratio() for username in
> usernames]
>     best = max(ratios)
>     owner = usernames[ratios.index(best)]
>     print filename,":",owner

It amazes me that I can still find a surprising new tool in the stdlib
after all these years.

Neat.

/pinboards

-- 

   Stephen Hansen
   ... Also: Ixokai
   ... Mail: me+list/python (AT) ixokai (DOT) io
   ... Blog: http://meh.ixokai.io/

Attachment: signature.asc
Description: OpenPGP digital signature

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to