Examples of skipTo()


Examples of it.unimi.dsi.mg4j.index.IndexIterator.skipTo()

    assertEquals( Integer.MAX_VALUE, indexIterator.skipTo( Integer.MAX_VALUE ) );
    indexIterator.dispose();

    indexIterator = index.documents( "a" );
    assertEquals( 0, indexIterator.skipTo( 0 ) );
    assertEquals( 1, indexIterator.skipTo( 1 ) );
    assertEquals( Integer.MAX_VALUE, indexIterator.skipTo( 2 ) );
    indexIterator.dispose();
}
}
View Full Code Here

Examples of it.unimi.dsi.mg4j.index.IndexIterator.skipTo()

    indexIterator.dispose();

    indexIterator = index.documents( "a" );
    assertEquals( 0, indexIterator.skipTo( 0 ) );
    assertEquals( 1, indexIterator.skipTo( 1 ) );
    assertEquals( Integer.MAX_VALUE, indexIterator.skipTo( 2 ) );
    indexIterator.dispose();
}
}
View Full Code Here

Examples of it.unimi.dsi.mg4j.search.DocumentIterator.skipTo()

        ObjectArrays.quickSort( sorted, DocumentScoreInfo.DOCUMENT_COMPARATOR );

        documentIterator = query[ i ].accept( builderVisitor.prepare() );
     
        for( DocumentScoreInfo<Reference2ObjectMap<Index,SelectedInterval[]>> dsi: sorted ) {
          documentIterator.skipTo( dsi.document );
          dsi.info = intervalSelector.select( documentIterator, new Reference2ObjectArrayMap<Index,SelectedInterval[]>( numIndices ) );
        }
     
        documentIterator.dispose();
      }
View Full Code Here

Examples of it.unimi.dsi.mg4j.search.DocumentIterator.skipTo()

  public void testSkipBug() throws QueryParserException, QueryBuilderVisitorException, IOException {
    Query query = simpleParser.parse( "a + b + c" );
    DocumentIteratorBuilderVisitor documentIteratorBuilderVisitor = new DocumentIteratorBuilderVisitor( null, index, Integer.MAX_VALUE );
    DocumentIterator documentIterator = query.accept( documentIteratorBuilderVisitor );
    assertEquals( 2, documentIterator.skipTo( 2 ) );
    documentIterator.dispose();
  }
 

  public void test() throws IOException {
View Full Code Here

Examples of it.unimi.dsi.mg4j.search.DocumentIterator.skipTo()

    i0.reset();
    i1.reset();
    i2.reset();

    consecutiveDocumentIterator = ConsecutiveDocumentIterator.getInstance( i0, i1, i2 );
    assertEquals( 2, consecutiveDocumentIterator.skipTo( 2 ) );
    assertEquals( 2, consecutiveDocumentIterator.document() );
    assertEquals( Interval.valueOf( 2 ), consecutiveDocumentIterator.intervalIterator().nextInterval() );
    assertFalse( consecutiveDocumentIterator.intervalIterator().hasNext() );
    assertEquals( 3, consecutiveDocumentIterator.nextDocument() );
    assertFalse( consecutiveDocumentIterator.hasNext() );
View Full Code Here

Examples of it.unimi.dsi.mg4j.search.DocumentIterator.skipTo()

    i0.reset();
    i1.reset();
    i2.reset();

    consecutiveDocumentIterator = ConsecutiveDocumentIterator.getInstance( i0, i1, i2 );
    assertEquals( 2, consecutiveDocumentIterator.skipTo( 1 ) );
    assertEquals( 2, consecutiveDocumentIterator.document() );
    assertEquals( Interval.valueOf( 0, 2 ), consecutiveDocumentIterator.intervalIterator().nextInterval() );
    assertFalse( consecutiveDocumentIterator.intervalIterator().hasNext() );
    assertEquals( 3, consecutiveDocumentIterator.nextDocument() );
    assertEquals( 3, consecutiveDocumentIterator.document() );
View Full Code Here

Examples of it.unimi.dsi.mg4j.search.DocumentIterator.skipTo()

          }
        };


        for (int document = 0; document < index.numberOfDocuments; document++) {
            currDoc[ 0 ] = iterator.skipTo(document);

            if (document == currDoc[ 0 ]) {
               iterator.accept(visitor); // see method visit below.
            }
        }
View Full Code Here

Examples of it.unimi.dsi.mg4j.search.DocumentIterator.skipTo()

 
  public void testSkipBug() throws QueryParserException, QueryBuilderVisitorException, IOException {
    Query query = simpleParser.parse( "a | b | c" );
    DocumentIteratorBuilderVisitor documentIteratorBuilderVisitor = new DocumentIteratorBuilderVisitor( null, index, Integer.MAX_VALUE );
    DocumentIterator documentIterator = query.accept( documentIteratorBuilderVisitor );
    assertEquals( 2, documentIterator.skipTo( 2 ) );
    documentIterator.dispose();
  }
 

  public void testOr() throws IOException {
View Full Code Here

Examples of it.unimi.dsi.mg4j.search.DocumentIterator.skipTo()

        { { 1, 3 } },
        { {} },
        { {} },
        } );
    DocumentIterator differenceIterator = DifferenceDocumentIterator.getInstance( minuendIterator, subtrahendIterator );
    assertEquals( 2, differenceIterator.skipTo( 1 ) );
    assertEquals( 2, differenceIterator.skipTo( 1 ) ); // To increase coverage
    assertEquals( Integer.MAX_VALUE, differenceIterator.skipTo( 4 ) );

    minuendIterator.reset();
    subtrahendIterator.reset();
View Full Code Here

Examples of it.unimi.dsi.mg4j.search.DocumentIterator.skipTo()

        { {} },
        { {} },
        } );
    DocumentIterator differenceIterator = DifferenceDocumentIterator.getInstance( minuendIterator, subtrahendIterator );
    assertEquals( 2, differenceIterator.skipTo( 1 ) );
    assertEquals( 2, differenceIterator.skipTo( 1 ) ); // To increase coverage
    assertEquals( Integer.MAX_VALUE, differenceIterator.skipTo( 4 ) );

    minuendIterator.reset();
    subtrahendIterator.reset();
    differenceIterator = DifferenceDocumentIterator.getInstance( minuendIterator, subtrahendIterator );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.