2727 * Encodes a string into a Cologne Phonetic value.
2828 * </p>
2929 * <p>
30- * Implements the <a href="http://de.wikipedia.org/wiki/K%C3%B6lner_Phonetik">“Kölner Phonetic” </a> (Cologne Phonetic)
30+ * Implements the <a href="http://de.wikipedia.org/wiki/K%C3%B6lner_Phonetik">“Kölner Phonetic� </a> (Cologne Phonetic)
3131 * algorithm issued by Hans Joachim Postel in 1969.
3232 * </p>
3333 *
3434 * <p>
35- * The <i>Kölner Phonetik</i> is a phonetic algorithm which is optimized for the German language. It is related to the
35+ * The <i>Kölner Phonetik</i> is a phonetic algorithm which is optimized for the German language. It is related to the
3636 * well-known soundex algorithm.
3737 * </p>
3838 *
151151 * </table>
152152 * <p>
153153 * <small><i>(Source: <a href= "http://de.wikipedia.org/wiki/K%C3%B6lner_Phonetik#Buchstabencodes" >Wikipedia (de):
154- * Kölner Phonetik – Buchstabencodes</a>)</i></small>
154+ * Kölner Phonetik – Buchstabencodes</a>)</i></small>
155155 * </p>
156156 *
157157 * <h4>Example:</h4>
158158 *
159- * {@code "Müller-Lüdenscheidt " => "MULLERLUDENSCHEIDT" => "6005507500206880022"}
159+ * {@code "Müller-Lüdenscheidt " => "MULLERLUDENSCHEIDT" => "6005507500206880022"}
160160 *
161161 * </li>
162162 *
168168 *
169169 * <li>
170170 * <h3>Step 3:</h3>
171- * Removal of all codes “0” except at the beginning. This means that two or more identical consecutive digits can occur
171+ * Removal of all codes “0� except at the beginning. This means that two or more identical consecutive digits can occur
172172 * if they occur after removing the "0" digits.
173173 *
174174 * <h4>Example:</h4>
175175 * {@code "6050750206802" => "65752682"}</li>
176176 *
177177 * </ul>
178178 *
179- * @see <a href="http://de.wikipedia.org/wiki/K%C3%B6lner_Phonetik">Wikipedia (de): Kölner Phonetik (in German)</a>
179+ * @see <a href="http://de.wikipedia.org/wiki/K%C3%B6lner_Phonetik">Wikipedia (de): Kölner Phonetik (in German)</a>
180180 * @author Apache Software Foundation
181181 * @since 1.5
182182 */
@@ -204,6 +204,7 @@ public int length() {
204204 return length ;
205205 }
206206
207+ @ Override
207208 public String toString () {
208209 return new String (copyData (0 , length ));
209210 }
@@ -220,6 +221,7 @@ public void addRight(char chr) {
220221 length ++;
221222 }
222223
224+ @ Override
223225 protected char [] copyData (int start , final int length ) {
224226 char [] newData = new char [length ];
225227 System .arraycopy (data , start , newData , 0 , length );
@@ -238,6 +240,7 @@ public void addLeft(char ch) {
238240 data [getNextPos ()] = ch ;
239241 }
240242
243+ @ Override
241244 protected char [] copyData (int start , final int length ) {
242245 char [] newData = new char [length ];
243246 System .arraycopy (data , data .length - this .length + start , newData , 0 , length );
@@ -259,10 +262,10 @@ public char removeNext() {
259262 }
260263 }
261264
262- private static final char [][] PREPROCESS_MAP = new char [][]{{'\u00C4' , 'A' }, // Ä
263- {'\u00DC' , 'U' }, // Ü
264- {'\u00D6' , 'O' }, // Ö
265- {'\u00DF' , 'S' } // ß
265+ private static final char [][] PREPROCESS_MAP = new char [][]{{'\u00C4' , 'A' }, // Ä
266+ {'\u00DC' , 'U' }, // Ü
267+ {'\u00D6' , 'O' }, // Ö
268+ {'\u00DF' , 'S' } // ß
266269 };
267270
268271 /*
@@ -279,14 +282,14 @@ private static boolean arrayContains(char[] arr, char key) {
279282
280283 /**
281284 * <p>
282- * <b>colognePhonetic()</b> is the actual implementations of the <i>Kölner Phonetik</i> algorithm.
285+ * <b>colognePhonetic()</b> is the actual implementations of the <i>Kölner Phonetik</i> algorithm.
283286 * </p>
284287 * <p>
285288 * In contrast to the initial description of the algorithm, this implementation does the encoding in one pass.
286289 * </p>
287290 *
288291 * @param text
289- * @return the corresponding encoding according to the <i>Kölner Phonetik</i> algorithm
292+ * @return the corresponding encoding according to the <i>Kölner Phonetik</i> algorithm
290293 */
291294 public String colognePhonetic (String text ) {
292295 if (text == null ) {
@@ -376,7 +379,7 @@ public String colognePhonetic(String text) {
376379
377380 public Object encode (Object object ) throws EncoderException {
378381 if (!(object instanceof String )) {
379- throw new EncoderException ("This method’ s parameter was expected to be of the type " +
382+ throw new EncoderException ("This method’ s parameter was expected to be of the type " +
380383 String .class .getName () +
381384 ". But actually it was of the type " +
382385 object .getClass ().getName () +
@@ -394,7 +397,7 @@ public boolean isEncodeEqual(String text1, String text2) {
394397 }
395398
396399 /*
397- * Converts the string to upper case and replaces germanic umlauts, and the “ß” .
400+ * Converts the string to upper case and replaces germanic umlauts, and the “ß� .
398401 */
399402 private String preprocess (String text ) {
400403 text = text .toUpperCase (Locale .GERMAN );
0 commit comments