MusicRoom::Text::SoundexNG - Extended Soundex varient tuned for music tag handling


The Soundex algorithm was developed to help with the variable spelling of names that is encountered by those doing historical research. The idea is that each name creates a string based on what it sounds like. In this case the concept has been tuned for music tags (artist names, track names and album titles). So if someone types is "The Beatles" or "Beetels" the algorithm returns "btl". We can use this to help identify artists that are good candidates for what the user means.


Add a list of words to map, for example:

                  '\bwanna\b' => "want to",
                  '\boutta\b' => "out of");

Will map the word "wanna" to "want to" before applying the rest of the algorithm.

When the escape \b appears at the start or end of the pattern it will match the start or end of the string as well as a word boundary.


Add words to those that are removed when processing.


Process the string to produce a soundex version. For example

    my $sdx = MusicRoom::Text::SoundexNG::soundex("Paradise by the Dashboard Light");

sets $sdx to "prbs_by_bshbrb_lght".