Package it.unimi.dsi.mg4j.document

Examples of it.unimi.dsi.mg4j.document.StringArrayDocumentCollection


  private String basename;

  @Override
  public void setUp() throws ConfigurationException, SecurityException, IOException, URISyntaxException, ClassNotFoundException, InstantiationException, IllegalAccessException, InvocationTargetException, NoSuchMethodException {
    basename = File.createTempFile( getClass().getSimpleName(), "test" ).getCanonicalPath();
    new IndexBuilder( basename, new StringArrayDocumentCollection( "a", "b", "c" ) ).run();
    index = DiskBasedIndex.getInstance( basename + "-text", true, true );
  }
View Full Code Here


  private Object2ReferenceMap<String, Index> indexMap;

  @Override
  public void setUp() throws ConfigurationException, SecurityException, IOException, URISyntaxException, ClassNotFoundException, InstantiationException, IllegalAccessException, InvocationTargetException, NoSuchMethodException {
    basename = File.createTempFile( getClass().getSimpleName(), "test" ).getCanonicalPath();
    new IndexBuilder( basename + "0", new StringArrayDocumentCollection( "a b", "b c", "c" ) ).run();
    new IndexBuilder( basename + "1", new StringArrayDocumentCollection( "a b", "b c", "c" ) ).run();
    index0 = DiskBasedIndex.getInstance( basename + "0-text", true, true );
    index1 = DiskBasedIndex.getInstance( basename + "1-text", true, true );
    index2 = DiskBasedIndex.getInstance( basename + "0-text", true, true );
    index3 = DiskBasedIndex.getInstance( basename + "1-text", true, true );
    indexMap = new Object2ReferenceOpenHashMap<String, Index>( new String[] { "index0", "index1", "index2", "index3" }, new Index[] { index0, index1, index2, index3 } );
View Full Code Here

  }

  @SuppressWarnings("unchecked")
  public DocumentSequence getEmptySequence() throws ConfigurationException, IOException {
    if ( lastSequence != null ) lastSequence.close();
    return lastSequence = new CompositeDocumentSequence( new StringArrayDocumentCollection(), new IntArrayDocumentCollection(), new DateArrayDocumentCollection(),
        new MapVirtualDocumentCollection() );
  }
View Full Code Here

  private String basename;

  @Override
  public void setUp() throws ConfigurationException, SecurityException, IOException, URISyntaxException, ClassNotFoundException, InstantiationException, IllegalAccessException, InvocationTargetException, NoSuchMethodException {
    basename = File.createTempFile( getClass().getSimpleName(), "tmp" ).getCanonicalPath();
    new IndexBuilder( basename + "0", new StringArrayDocumentCollection( "a", "c", "a", "d" ) ).run();
    new IndexBuilder( basename + "1", new StringArrayDocumentCollection( "a", "c b", "a b" ) ).run();

    new Paste( basename, new String[] { basename + "0-text", basename + "1-text" }, false, true, 1024, null, 1024, CompressionFlags.DEFAULT_STANDARD_INDEX, false, false, 64, 10, 1024, 1000 ).run();   
    new Paste( basename + "-mo", new String[] { basename + "0-text", basename + "1-text" }, true, true, 1024, null, 1024, CompressionFlags.DEFAULT_STANDARD_INDEX, false, false, 64, 10, 1024, 1000 ).run();
  }
View Full Code Here

  private BitStreamIndex index;
  private SimpleParser simpleParser;
  public void setUp() throws ConfigurationException, SecurityException, IOException, URISyntaxException, ClassNotFoundException, InstantiationException, IllegalAccessException, InvocationTargetException, NoSuchMethodException {

    String basename = File.createTempFile( getClass().getSimpleName(), "test" ).getCanonicalPath();
    new IndexBuilder( basename, new StringArrayDocumentCollection( "a", "b", "c" ) ).run();
    index = DiskBasedIndex.getInstance( basename + "-text", true, true );
    simpleParser = new SimpleParser( index.termProcessor );
  }
View Full Code Here

  }
 
  // Contributed by Fabien Campagne
  public void testMG4JMultiTermPositionIssue() throws IllegalAccessException, NoSuchMethodException, ConfigurationException, IOException, InvocationTargetException, InstantiationException, ClassNotFoundException, URISyntaxException {
    String basename = File.createTempFile( getClass().getSimpleName(), "test" ).getCanonicalPath();
    new IndexBuilder( basename, new StringArrayDocumentCollection(
                "A B C D E F F G G",
                "G A T H S K L J W L",
                "E S K D L J F K L S J D L S J D",
                "E B"
    ) ).run();
View Full Code Here

public class ScanTest extends TestCase {

  public void testEverywhereTerms() throws IOException, ConfigurationException, SecurityException, URISyntaxException, ClassNotFoundException, InstantiationException, IllegalAccessException, InvocationTargetException, NoSuchMethodException {
   
    String basename = File.createTempFile( getClass().getSimpleName(), "everywhereTerms" ).getCanonicalPath();
    new IndexBuilder( basename, new StringArrayDocumentCollection( "a a" ) ).keepBatches( true ).run();
    IndexIterator indexIterator = Index.getInstance( basename + "-text@0" ).documents( 0 );
    indexIterator.next();
    assertEquals( 2, indexIterator.count() );
    int[] position = new int[ 2 ];
    indexIterator.positions( position );
View Full Code Here

  public void testSkipBug() throws QueryParserException, QueryBuilderVisitorException, IOException, ConfigurationException, SecurityException, URISyntaxException, ClassNotFoundException, InstantiationException, IllegalAccessException, InvocationTargetException, NoSuchMethodException {
    BitStreamIndex index;
    SimpleParser simpleParser;
    String basename = File.createTempFile( getClass().getSimpleName(), "test" ).getCanonicalPath();
    new IndexBuilder( basename, new StringArrayDocumentCollection( "a a b c d e" ) ).run();
    index = DiskBasedIndex.getInstance( basename + "-text", true, true );
    simpleParser = new SimpleParser( index.termProcessor );

    Query query = simpleParser.parse( "(a|b|d)<(a|b|d)" );
    DocumentIteratorBuilderVisitor documentIteratorBuilderVisitor = new DocumentIteratorBuilderVisitor( null, index, Integer.MAX_VALUE );
View Full Code Here

  private String basename;

  @Override
  public void setUp() throws ConfigurationException, SecurityException, IOException, URISyntaxException, ClassNotFoundException, InstantiationException, IllegalAccessException, InvocationTargetException, NoSuchMethodException {
    basename = File.createTempFile( getClass().getSimpleName(), "test" ).getCanonicalPath();
    new IndexBuilder( basename, new StringArrayDocumentCollection( "a", "b", "c" ) ).run();
    index = DiskBasedIndex.getInstance( basename + "-text", true, true );
    simpleParser = new SimpleParser( index.termProcessor );
  }
View Full Code Here

public class BitStreamIndexReaderTest extends TestCase {

  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();
View Full Code Here

TOP

Related Classes of it.unimi.dsi.mg4j.document.StringArrayDocumentCollection

Copyright © 2018 www.massapicom. 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.