Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!ut-sally!pyramid!decwrl!sun!falk From: falk@sun.uucp (Ed Falk) Newsgroups: net.sources Subject: Re: Re: soundex algorithm wanted Message-ID: <6928@sun.uucp> Date: Thu, 4-Sep-86 20:48:29 EDT Article-I.D.: sun.6928 Posted: Thu Sep 4 20:48:29 1986 Date-Received: Fri, 5-Sep-86 04:41:24 EDT References: <27@houligan.UUCP> <672@bnrmtv.UUCP> <1239@whuxl.UUCP> Organization: Sun Microsystems, Inc. Lines: 27 > > Unfortunately, it doesn't generate correct Soundex codes. > The algorithm is actually pretty tricky, and I've seen > lots that don't handle names like Lloyd and Manning > properly. Here's one that I believe is correct: > ----- Both this version and the previous version had the same bug, to wit: lc = tolower(*name); The 'tolower' function only works if the input was already upper case. (at least in bsd 4.2 that's the way it is). The line should read lc = isupper(*name) ? tolower(*name) : *name ; Also, this version left trailing "0"'s on the output. Is this right? Perhaps someone could just post the plain english description of soundex... thanx.. -- -ed falk, sun microsystems falk@sun.com sun!falk