Soundex is a phonetic algorithm for indexing names by sound, as pronounced in English. The goal is for names with the same pronunciation to be encoded to the same representation so that they can be matched despite minor differences in spelling. Soundex is the most widely known of all phonetic algorithms and is often used (incorrectly) as a synonym for "phonetic algorithm". Improvements to Soundex are the basis for many modern phonetic algorithms. (Wikipedia, 2007)
This module implements the original soundex algorithm developed by Robert Russell and Margaret Odell, patented in 1918 and 1922, as well as a variation called "American Soundex" used for US census data, and current maintained by the National Archives and Records Administration (NARA).
The soundex algorithm may be recognized from Donald Knuth's The Art of Computer Programming. The algorithm described by Knuth is the NARA algorithm.
The value returned for strings which have no soundex encoding is defined using '$Text::Soundex::nocode'. The default value is 'undef', however values such as ''Z000'' are commonly used alternatives.
For backward compatibility with older versions of this module the '$Text::Soundex::nocode' is exported into the caller's namespace as '$soundex_nocode'.
In scalar context, 'soundex()' returns the soundex code of its first argument. In list context, a list is returned in which each element is the soundex code for the corresponding argument passed to 'soundex()'. For example, the following code assigns @codes the value '('M200', 'S320')':
@codes = soundex qw(Mike Stok);
To use 'Text::Soundex' to generate codes that can be used to search one of the publically available US Censuses, a variant of the soundex algorithm must be used:
use Text::Soundex; $code = soundex_nara($name);
An example of where these algorithm differ follows:
use Text::Soundex; print soundex("Ashcraft"), "\n"; # prints: A226 print soundex_nara("Ashcraft"), "\n"; # prints: A261
Package Version | Update ID | Released | Package Hub Version | Platforms | Subpackages |
---|---|---|---|---|---|
3.05-bp156.3.4 info | GA Release | 2023-12-07 | 15 SP6 |
|
|
3.05-bp155.2.11 info | GA Release | 2023-05-17 | 15 SP5 |
|
|
3.05-bp154.1.24 info | GA Release | 2022-05-09 | 15 SP4 |
|
|
3.05-bp153.1.17 info | GA Release | 2021-03-06 | 15 SP3 |
|
|
3.05-bp152.3.15 info | GA Release | 2020-04-16 | 15 SP2 |
|
|
3.05-bp151.3.1 info | GA Release | 2019-07-16 | 15 SP1 |
|
|
3.05-bp151.2.16 info | GA Release | 2019-05-18 | 15 SP1 |
|
|
3.05-bp150.2.4 info | GA Release | 2018-07-30 | 15 |
|
|