note 14244 deleted from function.soundex by jimw

From: Date: Sat, 08 Dec 2001 23:35:19 +0000
Subject: note 14244 deleted from function.soundex by jimw
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-22345@lists.php.net to get a copy of this message
PHP's Soundex is conforming to Sybase, MS-SQL, Oracle, and Ingres defined SOUNDEX() SQL function, and also conforming to the Knuth definition, which all return a fixed length SOUNDEX() code. ONLY MySQL generates SOUNDEX() strings with varying length, and is not conforming to the standard function... One other use of SOUNDEX() is to build a fast hash of strings for person names, when indexing on the person name produces inefficient indexes (for example when building indexes with multiple keys, because it allows better statistics on the second column, when this code is also used in an application to manage a small collision list that can fit in a small array). But it's true that the first character is too much sensitive in some cases, one can build less sensitive codes by ignoring the first letter returned, as with the following PHP expression, where the letter 'H' is chosen because it is (most often) not sounded, and does not affect further numeric codes : substr(soundex('H' . $name), 2, 3)

« previous php.notes (#22345) next »