@Test public void testAdjacentCodes() { Assert.assertEquals("054800", soundex("AKSSOL")); Assert.assertEquals("547830|545783|594783|594578", soundex("GERSCHFELD")); }
public String soundex(final String source) { final String[] branches = soundex(source, true); final StringBuilder sb = new StringBuilder(); int index = 0; for (final String branch : branches) { sb.append(branch); if (++index < branches.length) { sb.append('|'); } } return sb.toString(); }
DaitchMokotoffSoundex implements StringEncoder { public String soundex(final String source) { final String[] branches = soundex(source, true); final StringBuilder sb = new StringBuilder(); int index = 0; for (final String branch : branches) { sb.append(branch); if (++index < branches.length) { sb.append('|'); } } return sb.toString(); } }
DaitchMokotoffSoundex implements StringEncoder { public String soundex(final String source) { final String[] branches = soundex(source, true); final StringBuilder sb = new StringBuilder(); int index = 0; for (final String branch : branches) { sb.append(branch); if (++index < branches.length) { sb.append('|'); } } return sb.toString(); } DaitchMokotoffSoundex();  DaitchMokotoffSoundex(final boolean folding); }
DaitchMokotoffSoundex implements StringEncoder { public String soundex(final String source) { final String[] branches = soundex(source, true); final StringBuilder sb = new StringBuilder(); int index = 0; for (final String branch : branches) { sb.append(branch); if (++index < branches.length) { sb.append('|'); } } return sb.toString(); } DaitchMokotoffSoundex();  DaitchMokotoffSoundex(final boolean folding); @Override Object encode(final Object obj); @Override String encode(final String source); String soundex(final String source); }
DaitchMokotoffSoundex implements StringEncoder { public String soundex(final String source) { final String[] branches = soundex(source, true); final StringBuilder sb = new StringBuilder(); int index = 0; for (final String branch : branches) { sb.append(branch); if (++index < branches.length) { sb.append('|'); } } return sb.toString(); } DaitchMokotoffSoundex();  DaitchMokotoffSoundex(final boolean folding); @Override Object encode(final Object obj); @Override String encode(final String source); String soundex(final String source);  }