Skip to content

Instantly share code, notes, and snippets.

Created Jun 23, 2015
Embed
What would you like to do?
def fuzzyfinder(text, collection):
results = []
for string in collection:
key = []
for x in text:
index = string.find(x)
if index == -1:
break
key.append(index)
else:
results.append((key, string))
return (y for _, y in sorted(results))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment