Skip to content

Commit

Permalink
No issue. Find bug warnings fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
Horsmann committed Dec 9, 2018
1 parent 7760599 commit 233c7d3
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 15 deletions.
Expand Up @@ -26,6 +26,7 @@
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
Expand Down Expand Up @@ -231,11 +232,16 @@ private List<List<String>> transformToList(List<String> sentences)

private int getEmbeddingsSize(File embedding) throws Exception
{
String readLine = null;
try (BufferedReader br = new BufferedReader(
new InputStreamReader(new FileInputStream(embedding), StandardCharsets.UTF_8))) {
readLine = br.readLine();
br.close();
}

BufferedReader br = new BufferedReader(
new InputStreamReader(new FileInputStream(embedding), "utf-8"));
String readLine = br.readLine();
br.close();
return readLine.split(" ").length - 1;
if (readLine != null) {
return readLine.split(" ").length - 1;
}
throw new NullPointerException("Value is null");
}
}
Expand Up @@ -22,7 +22,7 @@
public interface TcDeepLearning4jUser
{

public void run(File trainVec, File trainOutcome, File testVec, File testOutcome,
void run(File trainVec, File trainOutcome, File testVec, File testOutcome,
File embedding, int seed, int maximumLength, double threshold, File prediction)
throws Exception;

Expand Down
Expand Up @@ -232,7 +232,7 @@ private File createInputFile(JCas aJCas, boolean isSequenceMod)
@Override
public int compare(Instance o1, Instance o2)
{
return ((Integer) o1.getSequenceId()).compareTo(o2.getSequenceId());
return Integer.compare(o1.getSequenceId(), o2.getSequenceId());
}
});
}
Expand Down
Expand Up @@ -21,7 +21,6 @@
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.Properties;

import org.dkpro.lab.engine.TaskContext;
Expand All @@ -36,8 +35,6 @@
*/
public abstract class TcShallowClassifierTaskBase extends TcClassifierTaskBase {

protected Map<String, String> configuration;

@Discriminator(name = DIM_CLASSIFICATION_ARGS)
protected List<Object> classificationArguments;

Expand Down
Expand Up @@ -21,7 +21,6 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Comparator;
import java.util.List;

import org.apache.commons.io.FileUtils;
Expand Down Expand Up @@ -56,7 +55,6 @@
*/
public class ExperimentLearningCurve extends Experiment_ImplBase {

protected Comparator<String> comparator;
protected int aNumFolds = 10;

protected InitTask initTask;
Expand Down
Expand Up @@ -50,9 +50,6 @@ public class DeepExperimentBuilder
{
protected List<TcDeepLearningAdapter> backends;
protected List<Object> userCodePath;

File outputFolder;

protected String pythonPath;
protected String embeddingPath;
protected int maxLen;
Expand Down

0 comments on commit 233c7d3

Please sign in to comment.