Skip to content

Commit a50a203

Browse files
committed
Applying Sebb's fix from CODEC-56, along with a test
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/codec/trunk@589052 13f79535-47bb-0310-9956-ffa450edef68
1 parent e65d67e commit a50a203

2 files changed

Lines changed: 11 additions & 8 deletions

File tree

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,7 @@
3030
*/
3131
public class RefinedSoundex implements StringEncoder {
3232

33-
/**
34-
* This static variable contains an instance of the RefinedSoundex using
35-
* the US_ENGLISH mapping.
36-
*/
37-
public static final RefinedSoundex US_ENGLISH = new RefinedSoundex();
38-
39-
/**
33+
/**
4034
* RefinedSoundex is *refined* for a number of reasons one being that the
4135
* mappings have been altered. This implementation contains default
4236
* mappings for US English.
@@ -51,6 +45,12 @@ public class RefinedSoundex implements StringEncoder {
5145
private final char[] soundexMapping;
5246

5347
/**
48+
* This static variable contains an instance of the RefinedSoundex using
49+
* the US_ENGLISH mapping.
50+
*/
51+
public static final RefinedSoundex US_ENGLISH = new RefinedSoundex();
52+
53+
/**
5454
* Creates an instance of the RefinedSoundex object using the default US
5555
* English mapping.
5656
*/

src/test/org/apache/commons/codec/language/RefinedSoundexTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,13 @@ public void testEncode() {
104104
assertEquals("T60", this.getEncoder().encode("the"));
105105
assertEquals("L7050", this.getEncoder().encode("lazy"));
106106
assertEquals("D6043", this.getEncoder().encode("dogs"));
107+
108+
// Testing CODEC-56
109+
assertEquals("D6043", RefinedSoundex.US_ENGLISH.encode("dogs"));
107110
}
108111

109112
public void testGetMappingCodeNonLetter() {
110113
char code = this.getEncoder().getMappingCode('#');
111114
assertEquals("Code does not equals zero", 0, code);
112115
}
113-
}
116+
}

0 commit comments

Comments
 (0)