Dominik Fuchß 4 лет назад
Родитель
Сommit
b53bf0a4ad
1 измененных файлов с 9 добавлено и 3 удалено
  1. 9 3
      jplag.cli/src/main/java/de/jplag/CLI.java

+ 9 - 3
jplag.cli/src/main/java/de/jplag/CLI.java

@@ -159,7 +159,8 @@ public final class CLI {
 
         ClusteringOptions clusteringOptions = new ClusteringOptions();
         if (CLUSTER_DISABLE.isSet(namespace)) {
-            clusteringOptions = clusteringOptions.withEnabled(CLUSTER_DISABLE.getFrom(namespace));
+            boolean disabled = CLUSTER_DISABLE.getFrom(namespace);
+            clusteringOptions = clusteringOptions.withEnabled(!disabled);
         }
         if (CLUSTER_ALGORITHM.isSet(namespace)) {
             clusteringOptions = clusteringOptions.withAlgorithm(CLUSTER_ALGORITHM.getFrom(namespace));
@@ -190,16 +191,21 @@ public final class CLI {
                     .withAgglomerativeInterClusterSimilarity(CLUSTER_AGGLOMERATIVE_INTER_CLUSTER_SIMILARITY.getFrom(namespace));
         }
         if (CLUSTER_PREPROCESSING_NONE.isSet(namespace)) {
-            clusteringOptions = clusteringOptions.withPreprocessor(Preprocessing.NONE);
+            if (CLUSTER_PREPROCESSING_NONE.getFrom(namespace)) {
+                clusteringOptions = clusteringOptions.withPreprocessor(Preprocessing.NONE);
+            }
         }
         if (CLUSTER_PREPROCESSING_CDF.isSet(namespace)) {
-            clusteringOptions = clusteringOptions.withPreprocessor(Preprocessing.CUMULATIVE_DISTRIBUTION_FUNCTION);
+            if (CLUSTER_PREPROCESSING_CDF.getFrom(namespace)) {
+                clusteringOptions = clusteringOptions.withPreprocessor(Preprocessing.CUMULATIVE_DISTRIBUTION_FUNCTION);
+            }
         }
         if (CLUSTER_PREPROCESSING_PERCENTILE.isSet(namespace)) {
             clusteringOptions = clusteringOptions.withPreprocessor(Preprocessing.PERCENTILE)
                     .withPreprocessorPercentile(CLUSTER_PREPROCESSING_PERCENTILE.getFrom(namespace));
         }
         if (CLUSTER_PREPROCESSING_THRESHOLD.isSet(namespace)) {
+
             clusteringOptions = clusteringOptions.withPreprocessor(Preprocessing.THRESHOLD)
                     .withPreprocessorPercentile(CLUSTER_PREPROCESSING_THRESHOLD.getFrom(namespace));
         }