You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by alessandrobenedetti <gi...@git.apache.org> on 2018/10/23 16:06:17 UTC
[GitHub] lucene-solr pull request #482: LUCENE-8539: fix some typos and improve style...
Github user alessandrobenedetti commented on a diff in the pull request:
https://github.com/apache/lucene-solr/pull/482#discussion_r227461971
--- Diff: lucene/core/src/test/org/apache/lucene/analysis/TestStopFilter.java ---
@@ -47,58 +48,65 @@ public void testStopFilt() throws IOException {
assertTokenStreamContents(stream, new String[] { "Now", "The" });
}
+
+ private void logStopwords(String name, List<String> stopwords){
+ // helper method: converts a list
+ log(String.format("stopword list \"%s:\"", name));
+ for (int i = 0; i < stopwords.size(); i++) {
+ log(String.format("stopword (%d): %s ", i, stopwords.get(i)));
+ }
+ log("----------");
+ }
/**
* Test Position increments applied by StopFilter with and without enabling this option.
*/
- public void testStopPositons() throws IOException {
+ public void testStopPositions() throws IOException {
+ final int NUMBER_OF_TOKENS = 20;
StringBuilder sb = new StringBuilder();
- ArrayList<String> a = new ArrayList<>();
- for (int i=0; i<20; i++) {
- String w = English.intToEnglish(i).trim();
- sb.append(w).append(" ");
- if (i%3 != 0) a.add(w);
+ List<String> stopwords = new ArrayList<>(NUMBER_OF_TOKENS);
--- End diff --
Maybe renaming sb -> inputText ?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org