lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uschind...@apache.org
Subject svn commit: r764654 - in /lucene/java/trunk/contrib/queries/src: java/org/apache/lucene/search/trie/ test/org/apache/lucene/search/trie/
Date Tue, 14 Apr 2009 00:36:03 GMT
Author: uschindler
Date: Tue Apr 14 00:36:02 2009
New Revision: 764654

URL: http://svn.apache.org/viewvc?rev=764654&view=rev
Log:
Small documentation updates, test fixed according to attributes documentation

Modified:
    lucene/java/trunk/contrib/queries/src/java/org/apache/lucene/search/trie/IntTrieTokenStream.java
    lucene/java/trunk/contrib/queries/src/java/org/apache/lucene/search/trie/LongTrieTokenStream.java
    lucene/java/trunk/contrib/queries/src/test/org/apache/lucene/search/trie/TestIntTrieTokenStream.java
    lucene/java/trunk/contrib/queries/src/test/org/apache/lucene/search/trie/TestLongTrieTokenStream.java

Modified: lucene/java/trunk/contrib/queries/src/java/org/apache/lucene/search/trie/IntTrieTokenStream.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queries/src/java/org/apache/lucene/search/trie/IntTrieTokenStream.java?rev=764654&r1=764653&r2=764654&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queries/src/java/org/apache/lucene/search/trie/IntTrieTokenStream.java
(original)
+++ lucene/java/trunk/contrib/queries/src/java/org/apache/lucene/search/trie/IntTrieTokenStream.java
Tue Apr 14 00:36:02 2009
@@ -50,12 +50,12 @@
  *  Field field = new Field(name, stream);
  *  field.setOmitNorms(true);
  *  field.setOmitTermFreqAndPositions(true);
+ *  Document doc = new Document();
+ *  document.add(field);
  *  <em>// use this code to index many documents:</em>
  *  stream.setValue(value1)
- *  document.add(field);
  *  writer.addDocument(document);
  *  stream.setValue(value2)
- *  document.add(field);
  *  writer.addDocument(document);
  *  ...
  * </pre>

Modified: lucene/java/trunk/contrib/queries/src/java/org/apache/lucene/search/trie/LongTrieTokenStream.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queries/src/java/org/apache/lucene/search/trie/LongTrieTokenStream.java?rev=764654&r1=764653&r2=764654&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queries/src/java/org/apache/lucene/search/trie/LongTrieTokenStream.java
(original)
+++ lucene/java/trunk/contrib/queries/src/java/org/apache/lucene/search/trie/LongTrieTokenStream.java
Tue Apr 14 00:36:02 2009
@@ -50,12 +50,12 @@
  *  Field field = new Field(name, stream);
  *  field.setOmitNorms(true);
  *  field.setOmitTermFreqAndPositions(true);
+ *  Document doc = new Document();
+ *  document.add(field);
  *  <em>// use this code to index many documents:</em>
  *  stream.setValue(value1)
- *  document.add(field);
  *  writer.addDocument(document);
  *  stream.setValue(value2)
- *  document.add(field);
  *  writer.addDocument(document);
  *  ...
  * </pre>

Modified: lucene/java/trunk/contrib/queries/src/test/org/apache/lucene/search/trie/TestIntTrieTokenStream.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queries/src/test/org/apache/lucene/search/trie/TestIntTrieTokenStream.java?rev=764654&r1=764653&r2=764654&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queries/src/test/org/apache/lucene/search/trie/TestIntTrieTokenStream.java
(original)
+++ lucene/java/trunk/contrib/queries/src/test/org/apache/lucene/search/trie/TestIntTrieTokenStream.java
Tue Apr 14 00:36:02 2009
@@ -29,10 +29,9 @@
   public void testStreamNewAPI() throws Exception {
     final IntTrieTokenStream stream=new IntTrieTokenStream(value, precisionStep);
     stream.setUseNewAPI(true);
+    // use getAttribute to test if attributes really exist, if not an IAE will be throwed
     final ShiftAttribute shiftAtt = (ShiftAttribute) stream.getAttribute(ShiftAttribute.class);
-    assertNotNull("Has shift attribute", shiftAtt);
     final TermAttribute termAtt = (TermAttribute) stream.getAttribute(TermAttribute.class);
-    assertNotNull("Has term attribute", termAtt);
     for (int shift=0; shift<32; shift+=precisionStep) {
       assertTrue("New token is available", stream.incrementToken());
       assertEquals("Shift value", shift, shiftAtt.getShift());

Modified: lucene/java/trunk/contrib/queries/src/test/org/apache/lucene/search/trie/TestLongTrieTokenStream.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/queries/src/test/org/apache/lucene/search/trie/TestLongTrieTokenStream.java?rev=764654&r1=764653&r2=764654&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queries/src/test/org/apache/lucene/search/trie/TestLongTrieTokenStream.java
(original)
+++ lucene/java/trunk/contrib/queries/src/test/org/apache/lucene/search/trie/TestLongTrieTokenStream.java
Tue Apr 14 00:36:02 2009
@@ -29,10 +29,9 @@
   public void testStreamNewAPI() throws Exception {
     final LongTrieTokenStream stream=new LongTrieTokenStream(value, precisionStep);
     stream.setUseNewAPI(true);
+    // use getAttribute to test if attributes really exist, if not an IAE will be throwed
     final ShiftAttribute shiftAtt = (ShiftAttribute) stream.getAttribute(ShiftAttribute.class);
-    assertNotNull("Has shift attribute", shiftAtt);
     final TermAttribute termAtt = (TermAttribute) stream.getAttribute(TermAttribute.class);
-    assertNotNull("Has term attribute", termAtt);
     for (int shift=0; shift<64; shift+=precisionStep) {
       assertTrue("New token is available", stream.incrementToken());
       assertEquals("Shift value", shift, shiftAtt.getShift());



Mime
View raw message