Skip to content

Commit 83a5ba3

Browse files
author
Timothy O'Brien
committed
Fixed bug reported by Dan Quaroni <dquaroni@openratings.com> dealing
with the maxCodeLen check at the tail end of the Metaphone alg. git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/codec/trunk@130189 13f79535-47bb-0310-9956-ffa450edef68
1 parent 8688129 commit 83a5ba3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/java/org/apache/commons/codec/language/Metaphone.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
* @author wbrogden@bga.com
6868
* @author bayard@generationjava.com
6969
* @author Tim O'Brien
70-
* @version $Id: Metaphone.java,v 1.4 2003/07/30 22:34:18 tobrien Exp $
70+
* @version $Id: Metaphone.java,v 1.5 2003/09/04 21:20:02 tobrien Exp $
7171
*/
7272
public class Metaphone implements StringEncoder {
7373

@@ -363,7 +363,7 @@ public String metaphone(String txt) {
363363
} // end switch
364364
n++ ;
365365
} // end else from symb != 'C'
366-
if (mtsz > 4) { code.setLength(4); }
366+
if (mtsz > maxCodeLen) { code.setLength(maxCodeLen); }
367367
}
368368
return code.toString();
369369
}

0 commit comments

Comments
 (0)