Skip to content

Commit

Permalink
adjust javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
Kr0nox committed Nov 4, 2024
1 parent 381bc5e commit 911ef5a
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions core/src/main/java/de/jplag/JPlagResult.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ public JPlagOptions getOptions() {

/**
* For the {@link SimilarityMetric} JPlag was run with, this returns the similarity distribution of detected matches in
* a 10-element array. Each entry represents the absolute frequency of matches whose similarity lies within the
* respective interval. Intervals: 0: [0% - 10%), 1: [10% - 20%), 2: [20% - 30%), ..., 9: [90% - 100%]
* a 100-element array. Each entry represents the absolute frequency of matches whose similarity lies within the
* respective interval. Intervals: 0: [0% - 1%), 1: [1% - 2%), 2: [2% - 3%), ..., 99: [99% - 100%]
* @return the similarity distribution array.
*/
public int[] getSimilarityDistribution() {
Expand All @@ -109,9 +109,9 @@ public int[] getSimilarityDistribution() {

/**
* For the {@link SimilarityMetric#MAX} that is built in to every {@link JPlagComparison}, this returns the similarity
* distribution of detected matches in a 10-element array. Each entry represents the absolute frequency of matches whose
* similarity lies within the respective interval. Intervals: 0: [0% - 10%), 1: [10% - 20%), 2: [20% - 30%), ..., 9:
* [90% - 100%]
* distribution of detected matches in a 100-element array. Each entry represents the absolute frequency of matches
* whose similarity lies within the respective interval. Intervals: 0: [0% - 1%), 1: [1% - 20%), 2: [2% - 3%), ..., 99:
* [99% - 100%]
* @return the similarity distribution array. When JPlag was run with the {@link SimilarityMetric#MAX}, this will return
* the same distribution as {@link JPlagResult#getSimilarityDistribution()}
*/
Expand All @@ -123,6 +123,12 @@ public List<ClusteringResult<Submission>> getClusteringResult() {
return this.clusteringResult;
}

/**
* Calculates the distribution of all comparisons. The distribution is boxed to a 100-Element Array, index with ranges:
* 0: [0%, 1%), 1: [1%, 2%), ..., 99: [99%, 100%]
* @param similarityMetric Metric to use
* @return the similarity distribution
*/
public List<Integer> calculateDistributionFor(ToDoubleFunction<JPlagComparison> similarityMetric) {
return Arrays.stream(calculateDistributionFor(this.comparisons, similarityMetric)).boxed().toList();
}
Expand Down

0 comments on commit 911ef5a

Please sign in to comment.