Examples of documents()


Examples of it.unimi.dsi.mg4j.index.Index.documents()

                        index.documents("C"),
                        index.documents("G")
                ),
                index.documents("W"),
                MultiTermIndexIterator.getInstance(
                        index.documents("S"),
                        index.documents("J")
                ));


        final int[] currDoc = new int[ 1 ];
View Full Code Here

Examples of it.unimi.dsi.mg4j.index.Index.documents()

                        index.documents("G")
                ),
                index.documents("W"),
                MultiTermIndexIterator.getInstance(
                        index.documents("S"),
                        index.documents("J")
                ));


        final int[] currDoc = new int[ 1 ];
        // A visitor invoking positionArray() on IndexIterators positioned on the current document.
View Full Code Here

Examples of it.unimi.dsi.mg4j.index.Index.documents()

 
  public void testPaste() throws IOException, ConfigurationException, SecurityException, URISyntaxException, ClassNotFoundException, InstantiationException, IllegalAccessException, InvocationTargetException, NoSuchMethodException {
   
   
    Index index = Index.getInstance( basename );
    assertEquals( 2, index.documents( 0 ).frequency() );     
    assertEquals( 2, index.documents( 1 ).frequency() );
    assertEquals( 1, index.documents( 2 ).frequency() );
    assertEquals( 1, index.documents( 3 ).frequency() );
   
    SemiExternalGammaList frequencies = new SemiExternalGammaList( new InputBitStream( basename + "-mo" + DiskBasedIndex.FREQUENCIES_EXTENSION ), 1, 4 );
View Full Code Here

Examples of it.unimi.dsi.mg4j.index.Index.documents()

  public void testPaste() throws IOException, ConfigurationException, SecurityException, URISyntaxException, ClassNotFoundException, InstantiationException, IllegalAccessException, InvocationTargetException, NoSuchMethodException {
   
   
    Index index = Index.getInstance( basename );
    assertEquals( 2, index.documents( 0 ).frequency() );     
    assertEquals( 2, index.documents( 1 ).frequency() );
    assertEquals( 1, index.documents( 2 ).frequency() );
    assertEquals( 1, index.documents( 3 ).frequency() );
   
    SemiExternalGammaList frequencies = new SemiExternalGammaList( new InputBitStream( basename + "-mo" + DiskBasedIndex.FREQUENCIES_EXTENSION ), 1, 4 );
View Full Code Here

Examples of it.unimi.dsi.mg4j.index.Index.documents()

   
   
    Index index = Index.getInstance( basename );
    assertEquals( 2, index.documents( 0 ).frequency() );     
    assertEquals( 2, index.documents( 1 ).frequency() );
    assertEquals( 1, index.documents( 2 ).frequency() );
    assertEquals( 1, index.documents( 3 ).frequency() );
   
    SemiExternalGammaList frequencies = new SemiExternalGammaList( new InputBitStream( basename + "-mo" + DiskBasedIndex.FREQUENCIES_EXTENSION ), 1, 4 );

    assertEquals( 2, frequencies.getLong( 0 ) );     
View Full Code Here

Examples of it.unimi.dsi.mg4j.index.Index.documents()

   
    Index index = Index.getInstance( basename );
    assertEquals( 2, index.documents( 0 ).frequency() );     
    assertEquals( 2, index.documents( 1 ).frequency() );
    assertEquals( 1, index.documents( 2 ).frequency() );
    assertEquals( 1, index.documents( 3 ).frequency() );
   
    SemiExternalGammaList frequencies = new SemiExternalGammaList( new InputBitStream( basename + "-mo" + DiskBasedIndex.FREQUENCIES_EXTENSION ), 1, 4 );

    assertEquals( 2, frequencies.getLong( 0 ) );     
    assertEquals( 2, frequencies.getLong( 1 ) );     
View Full Code Here

Examples of it.unimi.dsi.mg4j.index.Index.documents()

  public void testSkipToEndOfList() throws ConfigurationException, SecurityException, IOException, URISyntaxException, ClassNotFoundException, InstantiationException, IllegalAccessException, InvocationTargetException, NoSuchMethodException {
    String basename = File.createTempFile( getClass().getSimpleName(), "test" ).getCanonicalPath();
    new IndexBuilder( basename, new StringArrayDocumentCollection( new String[] { "a", "a", "c" } ) ).run();

    Index index = DiskBasedIndex.getInstance( basename + "-text", true, true );
    IndexIterator indexIterator = index.documents( "a" );
    assertEquals( Integer.MAX_VALUE, indexIterator.skipTo( Integer.MAX_VALUE ) );
    indexIterator.dispose();

    indexIterator = index.documents( "a" );
    assertEquals( 0, indexIterator.skipTo( 0 ) );
View Full Code Here

Examples of it.unimi.dsi.mg4j.index.Index.documents()

    Index index = DiskBasedIndex.getInstance( basename + "-text", true, true );
    IndexIterator indexIterator = index.documents( "a" );
    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.Index.documents()

    flc = new FileLinesCollection( basename + "-cluster-0.terms", "ASCII" );
    BinIO.storeObject( new ShiftAddXorSignedStringMap( flc.iterator(), new MWHCFunction<CharSequence>( flc , TransformationStrategies.utf16() ) ), basename + "-cluster-0.termmap" )
    flc = new FileLinesCollection( basename + "-cluster-1.terms", "ASCII" );
    BinIO.storeObject( new ShiftAddXorSignedStringMap( flc.iterator(), new MWHCFunction<CharSequence>( flc , TransformationStrategies.utf16() ) ), basename + "-cluster-1.termmap" )
    Index index = Index.getInstance( basename + "-cluster" );
    assertEquals( Integer.MAX_VALUE, index.documents( "b" ).skipTo( 2 ) );
  }
 
}
View Full Code Here

Examples of it.unimi.dsi.mg4j.index.IndexReader.documents()

   
    for(int i = 0;i<firstIndex.numberOfTerms;i++){
      try{
        System.out.println("term: " + i);
        firstIterator = firstIndexReader.documents(i);       
        secondIterator = !textTerm?secondIndexReader.documents(i):secondIndexReader.documents(firstIndex.termMap.list().get(i));       
       
        /** Compare hasNext*/
        Assert.assertEquals(firstIterator.hasNext(), secondIterator.hasNext());
       
        /** Compare frequency*/
 
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.