Sebb created CODEC-233:
--------------------------
Summary: Soundex should support more algorithm variants
Key: CODEC-233
URL: https://issues.apache.org/jira/browse/CODEC-233
Project: Commons Codec
Issue Type: New Feature
Reporter: Sebb
The existing Soundex class was designed around the American Soundex algorithm.
Whilst it offers some flexibility with the mapping of letters to Soundex
numbers, the list of the 'silent' letters H and W is built-in to the code.
There is no provision for changing the set of silent (ignored) letters.
There is also no way to change the designation of HW from silent into consonant
separator - i.e. code 0 - because that is how HW are currently encoded in the
public API.
To fix this, the mapping can be enhanced to support an extra code for 'silent'
letters.
A mapping which includes such a code did not have defined behaviour previously,
so can be treated differently - there is no need to assume HW are silent.
This allows for the definition of alternative silent letters.
It can also be used to map HW as code '0' - as long as there is at least one
'silent' code.
If there are no actual silent letters in the algorithm variant, then the code
can be appended to the end of the mapping. This will not affect processing as
only letters A-Z are passed to the method.
An alternative would be to introduce yet another code as an alias for '0', and
only treat HW as silent if they have code '0'.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)