lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ka...@apache.org
Subject svn commit: r674367 - in /lucene/java/trunk/contrib/analyzers/src: java/org/apache/lucene/analysis/shingle/ShingleMatrixFilter.java test/org/apache/lucene/analysis/shingle/TestShingleMatrixFilter.java
Date Mon, 07 Jul 2008 00:08:42 GMT
Author: kalle
Date: Sun Jul  6 17:08:41 2008
New Revision: 674367

URL: http://svn.apache.org/viewvc?rev=674367&view=rev
Log:
LUCENE-1320
ShingleMatrixFilter, a multidimensional shingle token filter.

Bug fix, did not support empty input token streams.

Modified:
    lucene/java/trunk/contrib/analyzers/src/java/org/apache/lucene/analysis/shingle/ShingleMatrixFilter.java
    lucene/java/trunk/contrib/analyzers/src/test/org/apache/lucene/analysis/shingle/TestShingleMatrixFilter.java

Modified: lucene/java/trunk/contrib/analyzers/src/java/org/apache/lucene/analysis/shingle/ShingleMatrixFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/analyzers/src/java/org/apache/lucene/analysis/shingle/ShingleMatrixFilter.java?rev=674367&r1=674366&r2=674367&view=diff
==============================================================================
--- lucene/java/trunk/contrib/analyzers/src/java/org/apache/lucene/analysis/shingle/ShingleMatrixFilter.java
(original)
+++ lucene/java/trunk/contrib/analyzers/src/java/org/apache/lucene/analysis/shingle/ShingleMatrixFilter.java
Sun Jul  6 17:08:41 2008
@@ -719,7 +719,7 @@
 
         public boolean hasNext() {
           int s = columnRowCounters.length;
-          return columnRowCounters[s - 1] < columns.get(s - 1).getRows().size();
+          return s != 0 && columnRowCounters[s - 1] < columns.get(s - 1).getRows().size();
         }
 
         public Column.Row[] next() {

Modified: lucene/java/trunk/contrib/analyzers/src/test/org/apache/lucene/analysis/shingle/TestShingleMatrixFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/analyzers/src/test/org/apache/lucene/analysis/shingle/TestShingleMatrixFilter.java?rev=674367&r1=674366&r2=674367&view=diff
==============================================================================
--- lucene/java/trunk/contrib/analyzers/src/test/org/apache/lucene/analysis/shingle/TestShingleMatrixFilter.java
(original)
+++ lucene/java/trunk/contrib/analyzers/src/test/org/apache/lucene/analysis/shingle/TestShingleMatrixFilter.java
Sun Jul  6 17:08:41 2008
@@ -22,6 +22,7 @@
 import org.apache.lucene.analysis.TokenStream;
 import org.apache.lucene.analysis.miscellaneous.PrefixAndSuffixAwareTokenFilter;
 import org.apache.lucene.analysis.miscellaneous.SingleTokenTokenStream;
+import org.apache.lucene.analysis.miscellaneous.EmptyTokenStream;
 import org.apache.lucene.analysis.payloads.PayloadHelper;
 import org.apache.lucene.analysis.shingle.ShingleMatrixFilter.Matrix;
 import org.apache.lucene.analysis.shingle.ShingleMatrixFilter.Matrix.Column;
@@ -42,7 +43,14 @@
     Token token = new Token(); // for debug use only
 
 
+
+
     TokenStream ts;
+
+
+    ts = new ShingleMatrixFilter(new EmptyTokenStream(), 1, 2, ' ', false, new ShingleMatrixFilter.OneDimensionalNonWeightedTokenSettingsCodec());
+    assertNull(ts.next());
+
     TokenListStream tls;
     LinkedList<Token> tokens;
 



Mime
View raw message