Edward Elliott wrote: > John Machin wrote: > > On 25/04/2006 6:26 PM, Iain King wrote: > >> iain = re.compile("(Ia(i)?n|Eoin)") > >> steven = re.compile("Ste(v|ph|f)(e|a)n") > > > > IMHO, the amount of hand-crafting that goes into a *general-purpose* > > phonetic matching algorithm is already bordering on overkill. Your > > method using REs would not appear to scale well at all. > > Also compare the readability of regular expressions in this case to a simple > list: > ["Steven", "Stephen", "Stefan", "Stephan", ...]
Somehow I'm the advocate for REs here, which: erg. But you have some mighty convenient elipses there... compare: steven = re.compile("Ste(v|ph|f|ff)(e|a)n") steven = ["Steven", "Stephen", "Stefen", "Steffen", "Stevan", "Stephan", "Stefan", "Steffan"] I know which I'd rather type. 'Course, if you can use a ready-built list of names... Iain -- http://mail.python.org/mailman/listinfo/python-list