Skip to content

Commit 63be79d

Browse files
committed
Javadoc
1 parent 5d57475 commit 63be79d

File tree

4 files changed

+13
-19
lines changed

4 files changed

+13
-19
lines changed

src/main/java/org/apache/commons/text/similarity/DamerauLevenshteinDistance.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ public class DamerauLevenshteinDistance implements EditDistance<Integer> {
3333
/**
3434
* Utility function to ensure distance is valid according to threshold.
3535
*
36-
* @param distance The distance value
37-
* @param threshold The threshold value
38-
* @return The distance value, or {@code -1} if distance is greater than threshold
36+
* @param distance The distance value.
37+
* @param threshold The threshold value.
38+
* @return The distance value, or {@code -1} if distance is greater than threshold.
3939
*/
4040
private static int clampDistance(final int distance, final int threshold) {
4141
return distance > threshold ? -1 : distance;
@@ -47,7 +47,7 @@ private static int clampDistance(final int distance, final int threshold) {
4747
* @param left the first SimilarityInput, must not be null.
4848
* @param right the second SimilarityInput, must not be null.
4949
* @param threshold the target threshold, must not be negative.
50-
* @return result distance, or -1 if distance exceeds threshold
50+
* @return result distance, or -1 if distance exceeds threshold.
5151
*/
5252
private static <E> int limitedCompare(SimilarityInput<E> left, SimilarityInput<E> right, final int threshold) {
5353
if (left == null || right == null) {

src/main/java/org/apache/commons/text/similarity/IntersectionResult.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,10 @@ public class IntersectionResult {
4949
/**
5050
* Constructs the results for an intersection between two sets.
5151
*
52-
* @param sizeA the size of set A ({@code |A|}).
53-
* @param sizeB the size of set B ({@code |B|}).
52+
* @param sizeA the size of set A ({@code |A|}).
53+
* @param sizeB the size of set B ({@code |B|}).
5454
* @param intersection the size of the intersection of A and B ({@code |A &#8745; B|}).
55-
* @throws IllegalArgumentException if the sizes are negative or the intersection is greater
56-
* than the minimum of the two set sizes.
55+
* @throws IllegalArgumentException if the sizes are negative or the intersection is greater than the minimum of the two set sizes.
5756
*/
5857
public IntersectionResult(final int sizeA, final int sizeB, final int intersection) {
5958
if (sizeA < 0) {
@@ -94,7 +93,7 @@ public int getIntersection() {
9493
/**
9594
* Gets the size of set A.
9695
*
97-
* @return |A|
96+
* @return {@code |A|}
9897
*/
9998
public int getSizeA() {
10099
return sizeA;
@@ -103,7 +102,7 @@ public int getSizeA() {
103102
/**
104103
* Gets the size of set B.
105104
*
106-
* @return |B|
105+
* @return {@code |B|}
107106
*/
108107
public int getSizeB() {
109108
return sizeB;

src/main/java/org/apache/commons/text/similarity/JaroWinklerDistance.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,10 @@ public class JaroWinklerDistance implements EditDistance<Double> {
3333
/**
3434
* Computes the Jaro-Winkler string matches, half transpositions, prefix array.
3535
*
36-
* @param first the first string to be matched.
36+
* @param first the first string to be matched.
3737
* @param second the second string to be matched.
3838
* @return array containing: matches, half transpositions, and prefix
39-
* @deprecated Deprecated as of 1.7. This method will be removed in 2.0, and moved to a Jaro Winkler similarity
40-
* class. TODO see TEXT-104.
39+
* @deprecated Deprecated as of 1.7. This method will be removed in 2.0, and moved to a Jaro Winkler similarity class. TODO see TEXT-104.
4140
*/
4241
@Deprecated
4342
protected static int[] matches(final CharSequence first, final CharSequence second) {

src/main/java/org/apache/commons/text/similarity/SimilarityScoreFrom.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,20 +66,16 @@ public class SimilarityScoreFrom<R> {
6666
* Constructs a new instance for a similarity score implementation and the "left" string.
6767
*
6868
* @param similarityScore This may not be null.
69-
* @param left This may be null here,
70-
* but the SimilarityScore#compare(CharSequence left, CharSequence right)
71-
* implementation may not accept nulls.
69+
* @param left This may be null here, but the SimilarityScore#compare(CharSequence left, CharSequence right) implementation may not accept nulls.
7270
*/
7371
public SimilarityScoreFrom(final SimilarityScore<R> similarityScore, final CharSequence left) {
7472
Validate.isTrue(similarityScore != null, "The edit distance may not be null.");
75-
7673
this.similarityScore = similarityScore;
7774
this.left = left;
7875
}
7976

8077
/**
81-
* Compares "left" field against the "right" parameter
82-
* using the "similarity score" implementation.
78+
* Compares "left" field against the "right" parameter using the "similarity score" implementation.
8379
*
8480
* @param right the second CharSequence.
8581
* @return The similarity score between two CharSequences.

0 commit comments

Comments
 (0)