@Test public void testNewInstance2() { assertEquals("D6043", new RefinedSoundex(RefinedSoundex.US_ENGLISH_MAPPING_STRING.toCharArray()).soundex("dogs")); }
public String soundex(String str) { if (str == null) { return null; } str = SoundexUtils.clean(str); if (str.length() == 0) { return str; } final StringBuilder sBuf = new StringBuilder(); sBuf.append(str.charAt(0)); char last, current; last = '*'; for (int i = 0; i < str.length(); i++) { current = getMappingCode(str.charAt(i)); if (current == last) { continue; } else if (current != 0) { sBuf.append(current); } last = current; } return sBuf.toString(); }
RefinedSoundex implements StringEncoder { public String soundex(String str) { if (str == null) { return null; } str = SoundexUtils.clean(str); if (str.length() == 0) { return str; } final StringBuilder sBuf = new StringBuilder(); sBuf.append(str.charAt(0)); char last, current; last = '*'; for (int i = 0; i < str.length(); i++) { current = getMappingCode(str.charAt(i)); if (current == last) { continue; } else if (current != 0) { sBuf.append(current); } last = current; } return sBuf.toString(); } }
RefinedSoundex implements StringEncoder { public String soundex(String str) { if (str == null) { return null; } str = SoundexUtils.clean(str); if (str.length() == 0) { return str; } final StringBuilder sBuf = new StringBuilder(); sBuf.append(str.charAt(0)); char last, current; last = '*'; for (int i = 0; i < str.length(); i++) { current = getMappingCode(str.charAt(i)); if (current == last) { continue; } else if (current != 0) { sBuf.append(current); } last = current; } return sBuf.toString(); } RefinedSoundex();  RefinedSoundex(final char[] mapping);  RefinedSoundex(final String mapping); }
RefinedSoundex implements StringEncoder { public String soundex(String str) { if (str == null) { return null; } str = SoundexUtils.clean(str); if (str.length() == 0) { return str; } final StringBuilder sBuf = new StringBuilder(); sBuf.append(str.charAt(0)); char last, current; last = '*'; for (int i = 0; i < str.length(); i++) { current = getMappingCode(str.charAt(i)); if (current == last) { continue; } else if (current != 0) { sBuf.append(current); } last = current; } return sBuf.toString(); } RefinedSoundex();  RefinedSoundex(final char[] mapping);  RefinedSoundex(final String mapping); int difference(final String s1, final String s2); @Override Object encode(final Object obj); @Override String encode(final String str); String soundex(String str); }
RefinedSoundex implements StringEncoder { public String soundex(String str) { if (str == null) { return null; } str = SoundexUtils.clean(str); if (str.length() == 0) { return str; } final StringBuilder sBuf = new StringBuilder(); sBuf.append(str.charAt(0)); char last, current; last = '*'; for (int i = 0; i < str.length(); i++) { current = getMappingCode(str.charAt(i)); if (current == last) { continue; } else if (current != 0) { sBuf.append(current); } last = current; } return sBuf.toString(); } RefinedSoundex();  RefinedSoundex(final char[] mapping);  RefinedSoundex(final String mapping); int difference(final String s1, final String s2); @Override Object encode(final Object obj); @Override String encode(final String str); String soundex(String str); static final String US_ENGLISH_MAPPING_STRING; static final RefinedSoundex US_ENGLISH; }