in reply to Matching in the Database...
You could subsequently do a Levenshtein distance from each key, if it's not found with this scheme, to try to guess one of the most likely choices. This is the kind of thing Google does when it doesn't find many hits after you search for "Londun UK".my %IATA = { }; $IATA{$_} = 'LON' for qw/lon london londonuk londonengland/; ... my $city = 'London, UK'; my $city =~ s/\W//g; my $code = $iata{lc($city)}; print $code, $/;
In general, soundex is deprecated. It's latin-alphabet-only, english-pronunciation-only, and it is not good with long words.
--
[ e d @ h a l l e y . c c ]
|
|---|