Skip to content

Instantly share code, notes, and snippets.

View soobrosa's full-sized avatar

Daniel Molnar soobrosa

View GitHub Profile
@soobrosa
soobrosa / difflibo.py
Created April 11, 2012 13:24
difflib chunk
import difflib
def neighbours(table, entry):
neighbour_list = difflib.get_close_matches(entry, table)
returns = {}
for neighbour in neighbour_list:
returns[neighbour] = difflib.SequenceMatcher(None, entry, neighbour).ratio()
return returns