From 911ef5aca1f45cdac386252f703bc56b27dd5f61 Mon Sep 17 00:00:00 2001 From: Alexander Vogt Date: Mon, 4 Nov 2024 08:41:56 +0100 Subject: [PATCH] adjust javadoc --- core/src/main/java/de/jplag/JPlagResult.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/de/jplag/JPlagResult.java b/core/src/main/java/de/jplag/JPlagResult.java index cb307c1d6..0ebff602b 100644 --- a/core/src/main/java/de/jplag/JPlagResult.java +++ b/core/src/main/java/de/jplag/JPlagResult.java @@ -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() { @@ -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()} */ @@ -123,6 +123,12 @@ public List> 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 calculateDistributionFor(ToDoubleFunction similarityMetric) { return Arrays.stream(calculateDistributionFor(this.comparisons, similarityMetric)).boxed().toList(); }