You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opennlp.apache.org by rz...@apache.org on 2024/01/04 22:10:06 UTC
(opennlp) branch OPENNLP-1542 updated (fc4aa6a5 -> 26be890b)
This is an automated email from the ASF dual-hosted git repository.
rzo1 pushed a change to branch OPENNLP-1542
in repository https://gitbox.apache.org/repos/asf/opennlp.git
omit fc4aa6a5 Fix checkstyle
omit 13e99ed0 See, if this will fix the current failures
new 26be890b OPENNLP-1542 - Fix NPE in Eval Tests
This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version. This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:
* -- * -- B -- O -- O -- O (fc4aa6a5)
\
N -- N -- N refs/heads/OPENNLP-1542 (26be890b)
You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.
Any revisions marked "omit" are not gone; other references still
refer to them. Any revisions marked "discard" are gone forever.
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../src/test/java/opennlp/tools/eval/ArvoresDeitadasEval.java | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
(opennlp) 01/01: OPENNLP-1542 - Fix NPE in Eval Tests
Posted by rz...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rzo1 pushed a commit to branch OPENNLP-1542
in repository https://gitbox.apache.org/repos/asf/opennlp.git
commit 26be890bfcf7e6663efaf26d2c0b8cb5a7cfac31
Author: Richard Zowalla <rz...@apache.org>
AuthorDate: Wed Jan 3 21:09:02 2024 +0100
OPENNLP-1542 - Fix NPE in Eval Tests
---
.../main/java/opennlp/tools/formats/ad/ADSentenceStream.java | 2 ++
.../src/test/java/opennlp/tools/eval/AbstractEvalTest.java | 3 +--
.../src/test/java/opennlp/tools/eval/ArvoresDeitadasEval.java | 10 +++++-----
3 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/opennlp-tools/src/main/java/opennlp/tools/formats/ad/ADSentenceStream.java b/opennlp-tools/src/main/java/opennlp/tools/formats/ad/ADSentenceStream.java
index 11cdc77c..36cfd4e0 100644
--- a/opennlp-tools/src/main/java/opennlp/tools/formats/ad/ADSentenceStream.java
+++ b/opennlp-tools/src/main/java/opennlp/tools/formats/ad/ADSentenceStream.java
@@ -338,6 +338,7 @@ public class ADSentenceStream extends FilterObjectStream<String, ADSentenceStrea
leaf.setLevel(level + 1);
leaf.setSyntacticTag("");
leaf.setMorphologicalTag("");
+ leaf.setFunctionalTag("");
leaf.setLexeme(lexeme);
return leaf;
@@ -349,6 +350,7 @@ public class ADSentenceStream extends FilterObjectStream<String, ADSentenceStrea
leaf.setLevel(1);
leaf.setSyntacticTag("");
leaf.setMorphologicalTag("");
+ leaf.setFunctionalTag("");
leaf.setLexeme(line);
return leaf;
diff --git a/opennlp-tools/src/test/java/opennlp/tools/eval/AbstractEvalTest.java b/opennlp-tools/src/test/java/opennlp/tools/eval/AbstractEvalTest.java
index 9d170956..b06af461 100644
--- a/opennlp-tools/src/test/java/opennlp/tools/eval/AbstractEvalTest.java
+++ b/opennlp-tools/src/test/java/opennlp/tools/eval/AbstractEvalTest.java
@@ -35,7 +35,6 @@ import opennlp.tools.ml.maxent.quasinewton.QNTrainer;
import opennlp.tools.ml.naivebayes.NaiveBayesTrainer;
import opennlp.tools.ml.perceptron.PerceptronTrainer;
import opennlp.tools.util.ObjectStream;
-import opennlp.tools.util.StringUtil;
import opennlp.tools.util.TrainingParameters;
import opennlp.tools.util.model.ModelUtil;
@@ -101,7 +100,7 @@ public abstract class AbstractEvalTest {
public static File getOpennlpDataDir() throws FileNotFoundException {
final String dataDirectory = System.getProperty("OPENNLP_DATA_DIR");
- if (StringUtil.isEmpty(dataDirectory)) {
+ if (dataDirectory == null || dataDirectory.isBlank()) {
throw new IllegalArgumentException("The OPENNLP_DATA_DIR is not set.");
}
final File file = new File(System.getProperty("OPENNLP_DATA_DIR"));
diff --git a/opennlp-tools/src/test/java/opennlp/tools/eval/ArvoresDeitadasEval.java b/opennlp-tools/src/test/java/opennlp/tools/eval/ArvoresDeitadasEval.java
index e7801281..4dcbcb06 100644
--- a/opennlp-tools/src/test/java/opennlp/tools/eval/ArvoresDeitadasEval.java
+++ b/opennlp-tools/src/test/java/opennlp/tools/eval/ArvoresDeitadasEval.java
@@ -188,26 +188,26 @@ public class ArvoresDeitadasEval extends AbstractEvalTest {
@Test
void evalPortugueseChunkerPerceptron() throws IOException {
chunkerCrossEval(createPerceptronParams(),
- 0.9638122825015589d);
+ 0.9631066789979492);
}
@Test
void evalPortugueseChunkerGis() throws IOException {
chunkerCrossEval(ModelUtil.createDefaultTrainingParameters(),
- 0.9573860781121228d);
+ 0.9571790438663504);
}
@Test
void evalPortugueseChunkerGisMultipleThreads() throws IOException {
TrainingParameters params = ModelUtil.createDefaultTrainingParameters();
params.put("Threads", 4);
- chunkerCrossEval(params, 0.9573860781121228d);
+ chunkerCrossEval(params, 0.9571790438663504);
}
@Test
void evalPortugueseChunkerQn() throws IOException {
chunkerCrossEval(createMaxentQnParams(),
- 0.9651009811896799d);
+ 0.9655574076677446);
}
@Test
@@ -216,7 +216,7 @@ public class ArvoresDeitadasEval extends AbstractEvalTest {
params.put("Threads", 4);
// NOTE: Should be the same as without multiple threads!!!
- chunkerCrossEval(params, 0.9649180953528779d);
+ chunkerCrossEval(params, 0.9655858045209428);
}
@Test