Possible Duplicate:
Matching incorrectly spelt words with correct ones in python
I have to interpret an incoming SMS that looks something like these:
SHOP NAME : CITY
Annies pet shop new york
Budds Calerfonia
Kelvins Boat Shop San Fransico
Karel Boom West palm beach
I have a list of cities and a list of shop names that I have to compare the sms with, if the shop name is there, great, is the city is there, perfect.
Now the thing is, people will spell these wrong etc. And because there is no separator like a comma, how would i know where the word is, starts and stops ?
I have looked at using the levenshtein function, and that returns the closest match in a list. But what if there is no match? Then I have to tell the user, sory, nothing matches your sms etc etc.
How will you go about doing that? Bare in mind, each sms campaign might have different number of parameters.