Package org.terrier.structures.collections.FSOrderedMapFile

Examples of org.terrier.structures.collections.FSOrderedMapFile.MapFileWriter


 
  @Override
  protected void setUp() throws Exception {
    super.setUp();
   
    MapFileWriter w = FSOrderedMapFile.mapFileWrite(file);
    FixedSizeWriteableFactory<Text> keyFactory = new FixedSizeTextFactory(20);
    int offset = 0;
    for(String key : testKeys)
    {
      Text wkey = keyFactory.newInstance();
      IntWritable wvalue = new IntWritable();
      wkey.set(key);
      wvalue.set(offset);

      w.write(wkey, wvalue);
      key2id.put(key, offset);
      offset++;
    }
    w.close();     
  }
View Full Code Here

TOP

Related Classes of org.terrier.structures.collections.FSOrderedMapFile.MapFileWriter

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.