From 8580e05d3178d69503c1cd26490973e945d4bc9e Mon Sep 17 00:00:00 2001 From: smarthi Date: Fri, 6 Jan 2017 17:32:32 -0500 Subject: [PATCH] OPENNLP-910: Add checkstyle --- checkstyle.xml | 75 +------------------ .../tools/ml/naivebayes/Probabilities.java | 11 ++- .../NewlineSentenceDetectorTest.java | 2 +- pom.xml | 2 +- 4 files changed, 13 insertions(+), 77 deletions(-) diff --git a/checkstyle.xml b/checkstyle.xml index e72b53d2e..ed428ed29 100644 --- a/checkstyle.xml +++ b/checkstyle.xml @@ -35,28 +35,17 @@ - - - - - - - - - - - @@ -72,38 +61,11 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -133,40 +94,10 @@ - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/opennlp-tools/src/main/java/opennlp/tools/ml/naivebayes/Probabilities.java b/opennlp-tools/src/main/java/opennlp/tools/ml/naivebayes/Probabilities.java index 394a4c6f1..10f448156 100644 --- a/opennlp-tools/src/main/java/opennlp/tools/ml/naivebayes/Probabilities.java +++ b/opennlp-tools/src/main/java/opennlp/tools/ml/naivebayes/Probabilities.java @@ -17,7 +17,12 @@ package opennlp.tools.ml.naivebayes; -import java.util.*; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; /** * Class implementing the probability distribution over labels returned by a classifier. @@ -26,7 +31,7 @@ * */ public abstract class Probabilities { - protected HashMap map = new HashMap<>(); + protected Map map = new HashMap<>(); protected transient boolean isNormalised = false; protected Map normalised; @@ -190,7 +195,7 @@ public double getMaxValue() { } public void discardCountsBelow(double i) { - ArrayList labelsToRemove = new ArrayList<>(); + List labelsToRemove = new ArrayList<>(); for (T label : map.keySet()) { Double sum = map.get(label); if (sum == null) sum = 0.0; diff --git a/opennlp-tools/src/test/java/opennlp/tools/sentdetect/NewlineSentenceDetectorTest.java b/opennlp-tools/src/test/java/opennlp/tools/sentdetect/NewlineSentenceDetectorTest.java index 92c2b915c..b209aed07 100644 --- a/opennlp-tools/src/test/java/opennlp/tools/sentdetect/NewlineSentenceDetectorTest.java +++ b/opennlp-tools/src/test/java/opennlp/tools/sentdetect/NewlineSentenceDetectorTest.java @@ -19,7 +19,7 @@ import org.junit.Test; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; /** * Tests for the {@link NewlineSentenceDetector} class. diff --git a/pom.xml b/pom.xml index e796e6654..ec76e5c17 100644 --- a/pom.xml +++ b/pom.xml @@ -166,7 +166,7 @@ true true ${project.basedir}/src/test/java - false + true **/stemmer/**/*