Просмотр исходного кода

Suppress the StanfordNLP logger.

Timur Sağlam 4 лет назад
Родитель
Сommit
7a09ffdc9a
1 измененных файлов с 2 добавлено и 0 удалено
  1. 2 0
      languages/text/src/main/java/de/jplag/text/ParserAdapter.java

+ 2 - 0
languages/text/src/main/java/de/jplag/text/ParserAdapter.java

@@ -15,6 +15,7 @@ import de.jplag.Token;
 import edu.stanford.nlp.ling.CoreLabel;
 import edu.stanford.nlp.ling.CoreLabel;
 import edu.stanford.nlp.pipeline.CoreDocument;
 import edu.stanford.nlp.pipeline.CoreDocument;
 import edu.stanford.nlp.pipeline.StanfordCoreNLP;
 import edu.stanford.nlp.pipeline.StanfordCoreNLP;
+import edu.stanford.nlp.util.logging.RedwoodConfiguration;
 
 
 public class ParserAdapter extends AbstractParser {
 public class ParserAdapter extends AbstractParser {
 
 
@@ -33,6 +34,7 @@ public class ParserAdapter extends AbstractParser {
     private int currentLineBreakIndex;
     private int currentLineBreakIndex;
 
 
     public ParserAdapter() {
     public ParserAdapter() {
+        RedwoodConfiguration.errorLevel().apply();
         Properties properties = new Properties();
         Properties properties = new Properties();
         properties.put(ANNOTATORS_KEY, ANNOTATORS_VALUE);
         properties.put(ANNOTATORS_KEY, ANNOTATORS_VALUE);
         this.pipeline = new StanfordCoreNLP(properties);
         this.pipeline = new StanfordCoreNLP(properties);