Skip to content

Commit a546baa

Browse files
committed
[CODEC-249] Add. test for Metaphone CH character translation with max code length of 5
1 parent 82af962 commit a546baa

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,6 @@ void testTranslateOfSCHAndCH() {
282282

283283
assertEquals("EX", getStringEncoder().metaphone("ECHO"));
284284

285-
assertEquals("XRKT", getStringEncoder().metaphone("CHARACTER"));
286285
assertEquals("TX", getStringEncoder().metaphone("TEACH"));
287286

288287
assertEquals("XR", getStringEncoder().metaphone("CHERI"));
@@ -295,6 +294,13 @@ void testTranslateOfSCHAndCH() {
295294

296295
}
297296

297+
@Test
298+
void testTranslateOfCHCharacterWithMaxCodeLenFive() {
299+
final Metaphone metaphone = new Metaphone();
300+
metaphone.setMaxCodeLen(5);
301+
assertEquals("XRKTR", metaphone.metaphone("CHARACTER"));
302+
}
303+
298304
@Test
299305
void testTranslateToJOfDGEOrDGIOrDGY() {
300306
assertEquals("TJ", getStringEncoder().metaphone("DODGY"));

0 commit comments

Comments
 (0)