Skip to content

Commit 4c0174f

Browse files
committed
Javadoc
1 parent 303bbaf commit 4c0174f

File tree

13 files changed

+137
-160
lines changed

13 files changed

+137
-160
lines changed

src/main/java/org/apache/commons/codec/language/AbstractCaverphone.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public AbstractCaverphone() {
4545
* the Encoder interface, and will throw an EncoderException if the supplied object is not of type {@link String}.
4646
*
4747
* @param source
48-
* Object to encode
48+
* Object to encode.
4949
* @return An object (or type {@link String}) containing the Caverphone code which corresponds to the String
5050
* supplied.
5151
* @throws EncoderException
@@ -65,9 +65,9 @@ public Object encode(final Object source) throws EncoderException {
6565
* This method might be promoted to a new AbstractStringEncoder superclass.
6666
*
6767
* @param str1
68-
* First of two strings to compare
68+
* First of two strings to compare.
6969
* @param str2
70-
* Second of two strings to compare
70+
* Second of two strings to compare.
7171
* @return {@code true} if the encodings of these strings are identical, {@code false} otherwise.
7272
* @throws EncoderException
7373
* thrown if there is an error condition during the encoding process.

src/main/java/org/apache/commons/codec/language/Caverphone.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ public Caverphone() {
5050
* Encodes the given String into a Caverphone value.
5151
*
5252
* @param source
53-
* String the source string
54-
* @return A Caverphone code for the given String
53+
* String the source string.
54+
* @return A Caverphone code for the given String.
5555
*/
5656
public String caverphone(final String source) {
5757
return this.encoder.encode(source);
@@ -62,7 +62,7 @@ public String caverphone(final String source) {
6262
* the Encoder interface, and will throw an EncoderException if the supplied object is not of type {@link String}.
6363
*
6464
* @param obj
65-
* Object to encode
65+
* Object to encode.
6666
* @return An object (or type {@link String}) containing the Caverphone code which corresponds to the String
6767
* supplied.
6868
* @throws EncoderException
@@ -80,8 +80,8 @@ public Object encode(final Object obj) throws EncoderException {
8080
* Encodes a String using the Caverphone algorithm.
8181
*
8282
* @param str
83-
* String object to encode
84-
* @return The Caverphone code corresponding to the String supplied
83+
* String object to encode.
84+
* @return The Caverphone code corresponding to the String supplied.
8585
*/
8686
@Override
8787
public String encode(final String str) {
@@ -92,9 +92,9 @@ public String encode(final String str) {
9292
* Tests if the Caverphones of two strings are identical.
9393
*
9494
* @param str1
95-
* First of two strings to compare
95+
* First of two strings to compare.
9696
* @param str2
97-
* Second of two strings to compare
97+
* Second of two strings to compare.
9898
* @return {@code true} if the Caverphones of these strings are identical, {@code false} otherwise.
9999
*/
100100
public boolean isCaverphoneEqual(final String str1, final String str2) {

src/main/java/org/apache/commons/codec/language/Caverphone1.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ public Caverphone1() {
4646
* Encodes the given String into a Caverphone value.
4747
*
4848
* @param source
49-
* String the source string
50-
* @return A Caverphone code for the given String
49+
* String the source string.
50+
* @return A Caverphone code for the given String.
5151
*/
5252
@Override
5353
public String encode(final String source) {

src/main/java/org/apache/commons/codec/language/Caverphone2.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ public Caverphone2() {
4646
* Encodes the given String into a Caverphone 2.0 value.
4747
*
4848
* @param source
49-
* String the source string
50-
* @return A Caverphone code for the given String
49+
* String the source string.
50+
* @return A Caverphone code for the given String.
5151
*/
5252
@Override
5353
public String encode(final String source) {

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -320,8 +320,8 @@ public ColognePhonetic() {
320320
* In contrast to the initial description of the algorithm, this implementation does the encoding in one pass.
321321
* </p>
322322
*
323-
* @param text The source text to encode
324-
* @return the corresponding encoding according to the <em>K&ouml;lner Phonetik</em> algorithm
323+
* @param text The source text to encode.
324+
* @return the corresponding encoding according to the <em>K&ouml;lner Phonetik</em> algorithm.
325325
*/
326326
public String colognePhonetic(final String text) {
327327
if (text == null) {
@@ -426,7 +426,7 @@ public String encode(final String text) {
426426
* @param text1 source text to encode before testing for equality.
427427
* @param text2 source text to encode before testing for equality.
428428
* @return {@code true} if the encoding the first string equals the encoding of the second string, {@code false}
429-
* otherwise
429+
* otherwise.
430430
*/
431431
public boolean isEncodeEqual(final String text1, final String text2) {
432432
return colognePhonetic(text1).equals(colognePhonetic(text2));

src/main/java/org/apache/commons/codec/language/DaitchMokotoffSoundex.java

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,9 @@ public int hashCode() {
123123
* Process the next replacement to be added to this branch.
124124
*
125125
* @param replacement
126-
* the next replacement to append
126+
* the next replacement to append.
127127
* @param forceAppend
128-
* indicates if the default processing shall be overridden
128+
* indicates if the default processing shall be overridden.
129129
*/
130130
private void processNextReplacement(final String replacement, final boolean forceAppend) {
131131
final boolean append = lastReplacement == null || !lastReplacement.endsWith(replacement) || forceAppend;
@@ -341,8 +341,8 @@ public DaitchMokotoffSoundex(final boolean folding) {
341341
* </p>
342342
*
343343
* @param input
344-
* the input string to clean up
345-
* @return a cleaned up string
344+
* the input string to clean up.
345+
* @return a cleaned up string.
346346
*/
347347
private String cleanup(final String input) {
348348
final StringBuilder sb = new StringBuilder();
@@ -369,13 +369,13 @@ private String cleanup(final String input) {
369369
*
370370
* @see #soundex(String)
371371
* @param obj
372-
* Object to encode
372+
* Object to encode.
373373
* @return An object (of type {@link String}) containing the DM Soundex code, which corresponds to the String
374374
* supplied.
375375
* @throws EncoderException
376-
* if the parameter supplied is not of type {@link String}
376+
* if the parameter supplied is not of type {@link String}.
377377
* @throws IllegalArgumentException
378-
* if a character is not mapped
378+
* if a character is not mapped.
379379
*/
380380
@Override
381381
public Object encode(final Object obj) throws EncoderException {
@@ -391,10 +391,10 @@ public Object encode(final Object obj) throws EncoderException {
391391
*
392392
* @see #soundex(String)
393393
* @param source
394-
* A String object to encode
395-
* @return A DM Soundex code corresponding to the String supplied
394+
* A String object to encode.
395+
* @return A DM Soundex code corresponding to the String supplied.
396396
* @throws IllegalArgumentException
397-
* if a character is not mapped
397+
* if a character is not mapped.
398398
*/
399399
@Override
400400
public String encode(final String source) {
@@ -422,10 +422,10 @@ public String encode(final String source) {
422422
* </p>
423423
*
424424
* @param source
425-
* A String object to encode
426-
* @return A string containing a set of DM Soundex codes corresponding to the String supplied
425+
* A String object to encode.
426+
* @return A string containing a set of DM Soundex codes corresponding to the String supplied.
427427
* @throws IllegalArgumentException
428-
* if a character is not mapped
428+
* if a character is not mapped.
429429
*/
430430
public String soundex(final String source) {
431431
return String.join("|", soundex(source, true));
@@ -435,11 +435,11 @@ public String soundex(final String source) {
435435
* Perform the actual DM Soundex algorithm on the input string.
436436
*
437437
* @param source
438-
* A String object to encode
438+
* A String object to encode.
439439
* @param branching
440-
* If branching shall be performed
440+
* If branching shall be performed.
441441
* @return A string array containing all DM Soundex codes corresponding to the String supplied depending on the
442-
* selected branching mode
442+
* selected branching mode.
443443
*/
444444
private String[] soundex(final String source, final boolean branching) {
445445
if (source == null) {

src/main/java/org/apache/commons/codec/language/DoubleMetaphone.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ protected static boolean contains(final String value, final int start, final int
214214
}
215215

216216
/**
217-
* Maximum length of an encoding, default is 4
217+
* Maximum length of an encoding, default is 4.
218218
*/
219219
private int maxCodeLen = 4;
220220

@@ -326,8 +326,8 @@ private boolean conditionM0(final String value, final int index) {
326326
/**
327327
* Encodes a value with Double Metaphone.
328328
*
329-
* @param value String to encode
330-
* @return an encoded string
329+
* @param value String to encode.
330+
* @return an encoded string.
331331
*/
332332
public String doubleMetaphone(final String value) {
333333
return doubleMetaphone(value, false);
@@ -336,9 +336,9 @@ public String doubleMetaphone(final String value) {
336336
/**
337337
* Encodes a value with Double Metaphone, optionally using the alternate encoding.
338338
*
339-
* @param value String to encode
340-
* @param alternate use alternate encode
341-
* @return an encoded string
339+
* @param value String to encode.
340+
* @param alternate use alternate encode.
341+
* @return an encoded string.
342342
*/
343343
public String doubleMetaphone(String value, final boolean alternate) {
344344
value = cleanInput(value);
@@ -451,9 +451,9 @@ public String doubleMetaphone(String value, final boolean alternate) {
451451
* Encodes the value using DoubleMetaphone. It will only work if
452452
* {@code obj} is a {@code String} (like {@code Metaphone}).
453453
*
454-
* @param obj Object to encode (should be of type String)
455-
* @return An encoded Object (will be of type String)
456-
* @throws EncoderException encode parameter is not of type String
454+
* @param obj Object to encode (should be of type String).
455+
* @return An encoded Object (will be of type String).
456+
* @throws EncoderException encode parameter is not of type String.
457457
*/
458458
@Override
459459
public Object encode(final Object obj) throws EncoderException {
@@ -466,8 +466,8 @@ public Object encode(final Object obj) throws EncoderException {
466466
/**
467467
* Encodes the value using DoubleMetaphone.
468468
*
469-
* @param value String to encode
470-
* @return An encoded String
469+
* @param value String to encode.
470+
* @return An encoded String.
471471
*/
472472
@Override
473473
public String encode(final String value) {
@@ -477,7 +477,7 @@ public String encode(final String value) {
477477
/**
478478
* Gets the maxCodeLen.
479479
*
480-
* @return int
480+
* @return the maxCodeLen.
481481
*/
482482
public int getMaxCodeLen() {
483483
return this.maxCodeLen;
@@ -1037,7 +1037,7 @@ private boolean isSlavoGermanic(final String value) {
10371037
}
10381038

10391039
/**
1040-
* Tests whether or not a character is a vowel or not
1040+
* Tests whether or not a character is a vowel or not.
10411041
*/
10421042
private boolean isVowel(final char ch) {
10431043
return VOWELS.indexOf(ch) != -1;
@@ -1046,7 +1046,7 @@ private boolean isVowel(final char ch) {
10461046
/**
10471047
* Sets the maxCodeLen.
10481048
*
1049-
* @param maxCodeLen The maxCodeLen to set
1049+
* @param maxCodeLen The maxCodeLen to set.
10501050
*/
10511051
public void setMaxCodeLen(final int maxCodeLen) {
10521052
this.maxCodeLen = maxCodeLen;

src/main/java/org/apache/commons/codec/language/MatchRatingApproachEncoder.java

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ public MatchRatingApproachEncoder() {
7979
* </p>
8080
*
8181
* @param name
82-
* The name to be cleaned
83-
* @return The cleaned name
82+
* The name to be cleaned.
83+
* @return The cleaned name.
8484
*/
8585
String cleanName(final String name) {
8686
String upperName = name.toUpperCase(Locale.ENGLISH);
@@ -99,11 +99,11 @@ String cleanName(final String name) {
9999
* Encoder interface Throws an EncoderException if input object is not of type {@link String}.
100100
*
101101
* @param object
102-
* Object to encode
102+
* Object to encode.
103103
* @return An object (or type {@link String}) containing the Match Rating Approach code which corresponds to the
104104
* String supplied.
105105
* @throws EncoderException
106-
* if the parameter supplied is not of type {@link String}
106+
* if the parameter supplied is not of type {@link String}.
107107
*/
108108
@Override
109109
public final Object encode(final Object object) throws EncoderException {
@@ -118,8 +118,8 @@ public final Object encode(final Object object) throws EncoderException {
118118
* Encodes a String using the Match Rating Approach (MRA) algorithm.
119119
*
120120
* @param name
121-
* String object to encode
122-
* @return The MRA code corresponding to the String supplied
121+
* String object to encode.
122+
* @return The MRA code corresponding to the String supplied.
123123
*/
124124
@Override
125125
public final String encode(String name) {
@@ -160,7 +160,7 @@ public final String encode(String name) {
160160
* </p>
161161
*
162162
* @param name
163-
* The string to get the substrings from
163+
* The string to get the substrings from.
164164
* @return Annexed first and last 3 letters of input word.
165165
*/
166166
String getFirst3Last3(final String name) {
@@ -184,8 +184,8 @@ String getFirst3Last3(final String name) {
184184
* </p>
185185
*
186186
* @param sumLength
187-
* The length of 2 strings sent down
188-
* @return The min rating value
187+
* The length of 2 strings sent down.
188+
* @return The min rating value.
189189
*/
190190
int getMinRating(final int sumLength) {
191191
int minRating = 0;
@@ -210,9 +210,9 @@ int getMinRating(final int sumLength) {
210210
* strings are cleaned in the same way as {@link #encode(String)}.
211211
*
212212
* @param name1
213-
* First of the 2 strings (names) to compare
213+
* First of the 2 strings (names) to compare.
214214
* @param name2
215-
* Second of the 2 names to compare
215+
* Second of the 2 names to compare.
216216
* @return {@code true} if the encodings are identical {@code false} otherwise.
217217
*/
218218
public boolean isEncodeEquals(String name1, String name2) {
@@ -295,9 +295,9 @@ boolean isVowel(final String letter) {
295295
* Consider this method private, it is package protected for unit testing only.
296296
* </p>
297297
*
298-
* @param name1
299-
* name2
300-
* @return the length as above
298+
* @param name1 first name.
299+
* @param name1 second name.
300+
* @return the length as above.
301301
*/
302302
int leftToRightThenRightToLeftProcessing(final String name1, final String name2) {
303303
final char[] name1Char = name1.toCharArray();
@@ -353,7 +353,7 @@ int leftToRightThenRightToLeftProcessing(final String name1, final String name2)
353353
*
354354
* @param accentedWord
355355
* The word that may have accents in it.
356-
* @return De-accented word
356+
* @return De-accented word.
357357
*/
358358
String removeAccents(final String accentedWord) {
359359
if (accentedWord == null) {
@@ -385,8 +385,8 @@ String removeAccents(final String accentedWord) {
385385
* </p>
386386
*
387387
* @param name
388-
* String to have double consonants removed
389-
* @return Single consonant word
388+
* String to have double consonants removed.
389+
* @return Single consonant word.
390390
*/
391391
String removeDoubleConsonants(final String name) {
392392
String replacedName = name.toUpperCase(Locale.ENGLISH);
@@ -408,8 +408,8 @@ String removeDoubleConsonants(final String name) {
408408
* </p>
409409
*
410410
* @param name
411-
* The name to have vowels removed
412-
* @return De-voweled word
411+
* The name to have vowels removed.
412+
* @return De-voweled word.
413413
*/
414414
String removeVowels(String name) {
415415
// Extract first letter

0 commit comments

Comments
 (0)