You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by dw...@apache.org on 2022/09/24 10:51:08 UTC

[lucene] branch main updated: Fix and simplify the test (#11734).

This is an automated email from the ASF dual-hosted git repository.

dweiss pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/lucene.git


The following commit(s) were added to refs/heads/main by this push:
     new 8bdfa90ea9b Fix and simplify the test (#11734).
8bdfa90ea9b is described below

commit 8bdfa90ea9b922a85aa161284f503e9b987fee8a
Author: Dawid Weiss <da...@carrotsearch.com>
AuthorDate: Sat Sep 24 12:51:01 2022 +0200

    Fix and simplify the test (#11734).
---
 .../analysis/opennlp/TestOpenNLPLemmatizerFilterFactory.java     | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/lucene/analysis/opennlp/src/test/org/apache/lucene/analysis/opennlp/TestOpenNLPLemmatizerFilterFactory.java b/lucene/analysis/opennlp/src/test/org/apache/lucene/analysis/opennlp/TestOpenNLPLemmatizerFilterFactory.java
index 681ec91eb22..20e42d38991 100644
--- a/lucene/analysis/opennlp/src/test/org/apache/lucene/analysis/opennlp/TestOpenNLPLemmatizerFilterFactory.java
+++ b/lucene/analysis/opennlp/src/test/org/apache/lucene/analysis/opennlp/TestOpenNLPLemmatizerFilterFactory.java
@@ -20,8 +20,6 @@ package org.apache.lucene.analysis.opennlp;
 import java.io.IOException;
 import java.io.InputStream;
 import java.nio.charset.StandardCharsets;
-import java.util.Arrays;
-import java.util.stream.Collectors;
 import org.apache.lucene.analysis.custom.CustomAnalyzer;
 import org.apache.lucene.analysis.miscellaneous.KeywordRepeatFilterFactory;
 import org.apache.lucene.analysis.miscellaneous.RemoveDuplicatesTokenFilterFactory;
@@ -332,11 +330,8 @@ public class TestOpenNLPLemmatizerFilterFactory extends BaseTokenStreamTestCase
       earlyExitOutput = loader.openResource("data/early-exit-bug-output.txt");
       String earlyExitOutputText =
           new String(earlyExitOutput.readAllBytes(), StandardCharsets.UTF_8);
-      String[] earlyExitOutputTexts =
-          Arrays.stream(earlyExitOutputText.split("\\s"))
-              .filter(text -> text != "")
-              .collect(Collectors.joining(" "))
-              .split(" ");
+      String[] earlyExitOutputTexts = earlyExitOutputText.split("[\\s\\r\\n]+");
+
       CustomAnalyzer analyzer =
           CustomAnalyzer.builder(new ClasspathResourceLoader(getClass()))
               .withTokenizer(