lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From o...@apache.org
Subject svn commit: r657279 - /lucene/java/trunk/contrib/analyzers/src/test/org/apache/lucene/analysis/shingle/ShingleFilterTest.java
Date Sat, 17 May 2008 01:55:48 GMT
Author: otis
Date: Fri May 16 18:55:48 2008
New Revision: 657279

URL: http://svn.apache.org/viewvc?rev=657279&view=rev
Log:
- Renamed vars a bit, so test is easier to understand

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

Modified: lucene/java/trunk/contrib/analyzers/src/test/org/apache/lucene/analysis/shingle/ShingleFilterTest.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/analyzers/src/test/org/apache/lucene/analysis/shingle/ShingleFilterTest.java?rev=657279&r1=657278&r2=657279&view=diff
==============================================================================
--- lucene/java/trunk/contrib/analyzers/src/test/org/apache/lucene/analysis/shingle/ShingleFilterTest.java
(original)
+++ lucene/java/trunk/contrib/analyzers/src/test/org/apache/lucene/analysis/shingle/ShingleFilterTest.java
Fri May 16 18:55:48 2008
@@ -163,27 +163,26 @@
                            TRI_GRAM_POSITION_INCREMENTS, TRI_GRAM_TYPES);
   }
 
-  protected void shingleFilterTest(int n, Token[] testToken, Token[] tokens,
+  protected void shingleFilterTest(int maxSize, Token[] tokensToShingle, Token[] tokensToCompare,
                                    int[] positionIncrements, String[] types)
     throws IOException {
 
-    TokenStream filter = new ShingleFilter(new TestTokenStream(testToken), n);
+    TokenStream filter = new ShingleFilter(new TestTokenStream(tokensToShingle), maxSize);
     Token token;
     int i = 0;
 
     while ((token = filter.next()) != null) {
       String termText = new String(token.termBuffer(), 0, token.termLength());
       String goldText
-        = new String(tokens[i].termBuffer(), 0, tokens[i].termLength());
+        = new String(tokensToCompare[i].termBuffer(), 0, tokensToCompare[i].termLength());
       assertEquals("Wrong termText", goldText, termText);
       assertEquals("Wrong startOffset for token \"" + termText + "\"",
-                   tokens[i].startOffset(), token.startOffset());
+          tokensToCompare[i].startOffset(), token.startOffset());
       assertEquals("Wrong endOffset for token \"" + termText + "\"",
-                   tokens[i].endOffset(), token.endOffset());
+          tokensToCompare[i].endOffset(), token.endOffset());
       assertEquals("Wrong positionIncrement for token \"" + termText + "\"",
-                   positionIncrements[i], token.getPositionIncrement());
-      assertEquals("Wrong type for token \"" + termText + "\"",
-                   types[i], token.type());
+          positionIncrements[i], token.getPositionIncrement());
+      assertEquals("Wrong type for token \"" + termText + "\"", types[i], token.type());
       i++;
     }
   }



Mime
View raw message