Skip to content

Commit f5db5a2

Browse files
committed
Javadoc
1 parent 4c0174f commit f5db5a2

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import org.apache.commons.codec.binary.StringUtils;
2525

2626
/**
27-
* Encodes a string into a double metaphone value. This Implementation is based on the algorithm by <CITE>Lawrence
27+
* Encodes a string into a Double Metaphone value. This Implementation is based on the algorithm by <CITE>Lawrence
2828
* Philips</CITE>.
2929
* <p>
3030
* This class is conditionally thread-safe. The instance field for the maximum code length is mutable

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,22 +57,22 @@
5757
public class Metaphone implements StringEncoder {
5858

5959
/**
60-
* Five values in the English language
60+
* Five values in the English language.
6161
*/
6262
private static final String VOWELS = "AEIOU";
6363

6464
/**
65-
* Variable used in Metaphone algorithm
65+
* Variable used in Metaphone algorithm.
6666
*/
6767
private static final String FRONTV = "EIY";
6868

6969
/**
70-
* Variable used in Metaphone algorithm
70+
* Variable used in Metaphone algorithm.
7171
*/
7272
private static final String VARSON = "CSPTG";
7373

7474
/**
75-
* The max code length for metaphone is 4
75+
* The max code length for Metaphone is 4.
7676
*/
7777
private int maxCodeLen = 4;
7878

@@ -84,11 +84,11 @@ public Metaphone() {
8484
}
8585

8686
/**
87-
* Encodes an Object using the metaphone algorithm. This method is provided in order to satisfy the requirements of the Encoder interface, and will throw an
87+
* Encodes an Object using the Metaphone algorithm. This method is provided in order to satisfy the requirements of the Encoder interface, and will throw an
8888
* EncoderException if the supplied object is not of type {@link String}.
8989
*
9090
* @param obj Object to encode.
91-
* @return An object (or type {@link String}) containing the metaphone code which corresponds to the String supplied.
91+
* @return An object (or type {@link String}) containing the Metaphone code which corresponds to the String supplied.
9292
* @throws EncoderException if the parameter supplied is not of type {@link String}.
9393
*/
9494
@Override
@@ -103,7 +103,7 @@ public Object encode(final Object obj) throws EncoderException {
103103
* Encodes a String using the Metaphone algorithm.
104104
*
105105
* @param str String object to encode
106-
* @return The metaphone code corresponding to the String supplied
106+
* @return The Metaphone code corresponding to the String supplied
107107
*/
108108
@Override
109109
public String encode(final String str) {
@@ -124,11 +124,11 @@ private boolean isLastChar(final int wdsz, final int n) {
124124
}
125125

126126
/**
127-
* Tests is the metaphones of two strings are identical.
127+
* Tests is the Metaphones of two strings are identical.
128128
*
129129
* @param str1 First of two strings to compare.
130130
* @param str2 Second of two strings to compare.
131-
* @return {@code true} if the metaphones of these strings are identical, {@code false} otherwise.
131+
* @return {@code true} if the Metaphones of these strings are identical, {@code false} otherwise.
132132
*/
133133
public boolean isMetaphoneEqual(final String str1, final String str2) {
134134
return metaphone(str1).equals(metaphone(str2));
@@ -155,14 +155,14 @@ private boolean isVowel(final StringBuilder string, final int index) {
155155
}
156156

157157
/**
158-
* Find the metaphone value of a String. This is similar to the
158+
* Find the Metaphone value of a String. This is similar to the
159159
* Soundex algorithm, but better at finding similar sounding words.
160160
* All input is converted to upper case.
161161
* Limitations: Input format is expected to be a single ASCII word
162162
* with only characters in the A - Z range, no punctuation or numbers.
163163
*
164-
* @param txt String to find the metaphone code for.
165-
* @return A metaphone code corresponding to the String supplied.
164+
* @param txt String to find the Metaphone code for.
165+
* @return A Metaphone code corresponding to the String supplied.
166166
*/
167167
public String metaphone(final String txt) {
168168
boolean hard = false;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,11 +287,11 @@ void testTranslateToJOfDGEOrDGIOrDGY() {
287287
}
288288

289289
/**
290-
* Tests (CODEC-57) Metaphone.metaphone(String) returns an empty string when passed the word "why"
290+
* Tests (CODEC-57) Metaphone.Metaphone(String) returns an empty string when passed the word "why"
291291
*/
292292
@Test
293293
void testWhy() {
294-
// PHP returns "H". The original metaphone returns an empty string.
294+
// PHP returns "H". The original Metaphone returns an empty string.
295295
assertEquals("", getStringEncoder().metaphone("WHY"));
296296
}
297297

0 commit comments

Comments
 (0)