You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ba...@apache.org on 2007/10/27 08:48:27 UTC

svn commit: r589052 - in /commons/proper/codec/trunk/src: java/org/apache/commons/codec/language/RefinedSoundex.java test/org/apache/commons/codec/language/RefinedSoundexTest.java

Author: bayard
Date: Fri Oct 26 23:48:26 2007
New Revision: 589052

URL: http://svn.apache.org/viewvc?rev=589052&view=rev
Log:
Applying Sebb's fix from CODEC-56, along with a test

Modified:
    commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/RefinedSoundex.java
    commons/proper/codec/trunk/src/test/org/apache/commons/codec/language/RefinedSoundexTest.java

Modified: commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/RefinedSoundex.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/RefinedSoundex.java?rev=589052&r1=589051&r2=589052&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/RefinedSoundex.java (original)
+++ commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/RefinedSoundex.java Fri Oct 26 23:48:26 2007
@@ -30,13 +30,7 @@
  */
 public class RefinedSoundex implements StringEncoder {
 
-    /**
-	 * This static variable contains an instance of the RefinedSoundex using
-	 * the US_ENGLISH mapping.
-	 */
-    public static final RefinedSoundex US_ENGLISH = new RefinedSoundex();
-
-    /**
+   /**
 	 * RefinedSoundex is *refined* for a number of reasons one being that the
 	 * mappings have been altered. This implementation contains default
 	 * mappings for US English.
@@ -51,6 +45,12 @@
     private final char[] soundexMapping;
 
     /**
+	 * This static variable contains an instance of the RefinedSoundex using
+	 * the US_ENGLISH mapping.
+	 */
+    public static final RefinedSoundex US_ENGLISH = new RefinedSoundex();
+
+     /**
 	 * Creates an instance of the RefinedSoundex object using the default US
 	 * English mapping.
 	 */

Modified: commons/proper/codec/trunk/src/test/org/apache/commons/codec/language/RefinedSoundexTest.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/test/org/apache/commons/codec/language/RefinedSoundexTest.java?rev=589052&r1=589051&r2=589052&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/test/org/apache/commons/codec/language/RefinedSoundexTest.java (original)
+++ commons/proper/codec/trunk/src/test/org/apache/commons/codec/language/RefinedSoundexTest.java Fri Oct 26 23:48:26 2007
@@ -104,10 +104,13 @@
         assertEquals("T60", this.getEncoder().encode("the"));
         assertEquals("L7050", this.getEncoder().encode("lazy"));
         assertEquals("D6043", this.getEncoder().encode("dogs"));
+
+        // Testing CODEC-56
+        assertEquals("D6043", RefinedSoundex.US_ENGLISH.encode("dogs"));
     }
 
 	public void testGetMappingCodeNonLetter() {
 		char code = this.getEncoder().getMappingCode('#');
 		assertEquals("Code does not equals zero", 0, code);
 	}
-}
\ No newline at end of file
+}