I am trying to see if a string I have is similar to any of the strings in a dictionary in python. When I am looking for exact matches, I can do this:
stringList = []
if (myString in stringList):
#do something
Looking for similar matches using Python Levenshtein is the best I can come up with (I'm sure with some errors).
stringList = []
for i in range(len(stringList)):
if distance(myString, stringList[i]) < 2:
#do something
else:
#do something else
Is there a better way? Thanks.