File tree Expand file tree Collapse file tree
src/java/org/apache/commons/codec/language Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2424 * general purpose scheme to find word with similar phonemes.
2525 *
2626 * @author Apache Software Foundation
27- * @version $Id: Soundex.java,v 1.26 2004/07/07 23:15:24 ggregory Exp $
27+ * @version $Id: Soundex.java,v 1.27 2004/09/08 17:44:41 ggregory Exp $
2828 */
2929public class Soundex implements StringEncoder {
3030
@@ -162,6 +162,7 @@ public String encode(String pString) {
162162 * if the character is not mapped
163163 */
164164 private char getMappingCode (String str , int index ) {
165+ // map() throws IllegalArgumentException
165166 char mappedChar = this .map (str .charAt (index ));
166167 // HW rule check
167168 if (index > 1 && mappedChar != '0' ) {
@@ -255,6 +256,7 @@ public String soundex(String str) {
255256 char last , mapped ;
256257 int incount = 1 , count = 1 ;
257258 out [0 ] = str .charAt (0 );
259+ // getMappingCode() throws IllegalArgumentException
258260 last = getMappingCode (str , 0 );
259261 while ((incount < str .length ()) && (count < out .length )) {
260262 mapped = getMappingCode (str , incount ++);
You can’t perform that action at this time.
0 commit comments