You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by to...@apache.org on 2003/09/04 23:20:02 UTC

cvs commit: jakarta-commons/codec/src/java/org/apache/commons/codec/language Metaphone.java

tobrien     2003/09/04 14:20:02

  Modified:    codec/src/java/org/apache/commons/codec/language
                        Metaphone.java
  Log:
  Fixed bug reported by Dan Quaroni <dq...@openratings.com> dealing
  with the maxCodeLen check at the tail end of the Metaphone alg.
  
  Revision  Changes    Path
  1.5       +2 -2      jakarta-commons/codec/src/java/org/apache/commons/codec/language/Metaphone.java
  
  Index: Metaphone.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/codec/src/java/org/apache/commons/codec/language/Metaphone.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Metaphone.java	30 Jul 2003 22:34:18 -0000	1.4
  +++ Metaphone.java	4 Sep 2003 21:20:02 -0000	1.5
  @@ -363,7 +363,7 @@
                   } // end switch
                   n++ ;
               } // end else from symb != 'C'
  -            if (mtsz > 4) { code.setLength(4); }
  +            if (mtsz > maxCodeLen) { code.setLength(maxCodeLen); }
           }
           return code.toString();
       }