mirror of https://github.com/apache/lucene.git
Fix and simplify the test (#11734).
This commit is contained in:
parent
188a78d769
commit
8bdfa90ea9
|
@ -20,8 +20,6 @@ package org.apache.lucene.analysis.opennlp;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.nio.charset.StandardCharsets;
|
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.custom.CustomAnalyzer;
|
||||||
import org.apache.lucene.analysis.miscellaneous.KeywordRepeatFilterFactory;
|
import org.apache.lucene.analysis.miscellaneous.KeywordRepeatFilterFactory;
|
||||||
import org.apache.lucene.analysis.miscellaneous.RemoveDuplicatesTokenFilterFactory;
|
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");
|
earlyExitOutput = loader.openResource("data/early-exit-bug-output.txt");
|
||||||
String earlyExitOutputText =
|
String earlyExitOutputText =
|
||||||
new String(earlyExitOutput.readAllBytes(), StandardCharsets.UTF_8);
|
new String(earlyExitOutput.readAllBytes(), StandardCharsets.UTF_8);
|
||||||
String[] earlyExitOutputTexts =
|
String[] earlyExitOutputTexts = earlyExitOutputText.split("[\\s\\r\\n]+");
|
||||||
Arrays.stream(earlyExitOutputText.split("\\s"))
|
|
||||||
.filter(text -> text != "")
|
|
||||||
.collect(Collectors.joining(" "))
|
|
||||||
.split(" ");
|
|
||||||
CustomAnalyzer analyzer =
|
CustomAnalyzer analyzer =
|
||||||
CustomAnalyzer.builder(new ClasspathResourceLoader(getClass()))
|
CustomAnalyzer.builder(new ClasspathResourceLoader(getClass()))
|
||||||
.withTokenizer(
|
.withTokenizer(
|
||||||
|
|
Loading…
Reference in New Issue