Skip to content

Commit b9cab09

Browse files
committed
Fix double digit bug.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/codec/trunk@1073481 13f79535-47bb-0310-9956-ffa450edef68
1 parent 546f871 commit b9cab09

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,10 +368,10 @@ public String colognePhonetic(String text) {
368368

369369
if (code != '-' && (lastCode != code && (code != '0' || lastCode == '/') || code < '0' || code > '8')) {
370370
left.addRight(code);
371+
lastCode = code;
371372
}
372373

373374
lastChar = chr;
374-
lastCode = code;
375375
}
376376
return left.toString();
377377
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ public void testPhpData() {
129129
{"peter", "127"},
130130
{"pharma", "376"},
131131
{"bergisch-gladbach", "174845214"},
132-
{"mönchengladbach", "664645214"},
132+
{"mönchengladbach", "64645214"},
133133
{"deutsch", "28"},
134134
{"deutz", "28"},
135135
{"hamburg", "06174"},
@@ -141,8 +141,8 @@ public void testPhpData() {
141141
{"matsch", "68"},
142142
{"matz", "68"},
143143
{"Arbeitsamt", "071862"},
144-
// {"Eberhard", "01772"}, BUG: 77 should be 7
145-
// {"Eberhardt", "01772"}, BUG: 77 should be 7
144+
{"Eberhard", "0172"},
145+
{"Eberhardt", "0172"},
146146
{"heithabu", "021"},
147147
{"Müller-Lüdenscheidt", "65752682"},};
148148
this.checkEncodings(data);

0 commit comments

Comments
 (0)