Package org.terrier.structures

Examples of org.terrier.structures.FSOMapFileLexiconOutputStream.writeNextEntry()


      while(lexIn.hasNext())
      {
        Map.Entry<String,LexiconEntry> e = lexIn.next();
        e.getValue().setTermId(termId);
        ((BitIndexPointer)e.getValue()).setFileNumber((byte)i);
        lexOut.writeNextEntry(e.getKey(), e.getValue());
        termId++;
      }
      IndexUtil.close(lexIn);
      //rename the inverted file to be part of the destination index
      Files.rename(
View Full Code Here


        if (lexicographicalCompare < 0) {
          //write to inverted file postings for the term that only occurs in 1st index
          BitIndexPointer newPointer = invOS.writePostings(inverted1.getPostings(lee1.getValue()));
          lee1.getValue().setPointer(newPointer);
          numberOfPointers+=newPointer.getNumberOfEntries();
          lexOutStream.writeNextEntry(term1, lee1.getValue());
          hasMore1 = lexInStream1.hasNext();
          if (hasMore1)
            lee1 = lexInStream1.next();
       
        } else if (lexicographicalCompare > 0) {
View Full Code Here

         
          int newCode = newCodes++;
          if (keepTermCodeMap)
            termcodeHashmap.put(lee2.getValue().getTermId(), newCode);
          lee2.getValue().setTermId(newCode);
          lexOutStream.writeNextEntry(term2, lee2.getValue());
          hasMore2 = lexInStream2.hasNext();
          if (hasMore2)
            lee2 = lexInStream2.next();
        } else {
          //write to postings for a term that occurs in both indices
View Full Code Here

          lee1.getValue().setPointer(newPointer1);
          if (keepTermCodeMap)
            termcodeHashmap.put(lee2.getValue().getTermId(), lee1.getValue().getTermId());
         
          lee1.getValue().add(lee2.getValue());
          lexOutStream.writeNextEntry(term1, lee1.getValue());
         
          hasMore1 = lexInStream1.hasNext();
          if (hasMore1)
            lee1 = lexInStream1.next();
         
View Full Code Here

          //write to inverted file as well.
          BitIndexPointer newPointer = invOS.writePostings(
              inverted1.getPostings(lee1.getValue()));
          lee1.getValue().setPointer(newPointer);
          numberOfPointers+=newPointer.getNumberOfEntries();
          lexOutStream.writeNextEntry(lee1.getKey(), lee1.getValue());
          hasMore1 = lexInStream1.hasNext();
          if (hasMore1)
            lee1 = lexInStream1.next();
        }
      } else if (hasMore2) {
View Full Code Here

          numberOfPointers+=newPointer.getNumberOfEntries();
          int newCode = newCodes++;
          if (keepTermCodeMap)
            termcodeHashmap.put(lee2.getValue().getTermId(), newCode);
          lee2.getValue().setTermId(newCode);
          lexOutStream.writeNextEntry(lee2.getKey(), lee2.getValue());
          hasMore2 = lexInStream2.hasNext();
          if (hasMore2)
            lee2 = lexInStream2.next();
        }   
      }
View Full Code Here

        term2 = lee2.getKey();
        int lexicographicalCompare = term1.compareTo(term2);
        if (lexicographicalCompare < 0) {
          lee1.getValue().setTermId(termId);
          lee1.getValue().setPointer(p);
          lexOutStream.writeNextEntry(term1, lee1.getValue());
          termId++;
          if (hasMore1 = lexInStream1.hasNext()) lee1 = lexInStream1.next();
       
        } else if (lexicographicalCompare > 0) {
          lee2.getValue().setTermId(termId);
View Full Code Here

          if (hasMore1 = lexInStream1.hasNext()) lee1 = lexInStream1.next();
       
        } else if (lexicographicalCompare > 0) {
          lee2.getValue().setTermId(termId);
          lee2.getValue().setPointer(p);
          lexOutStream.writeNextEntry(term2, lee2.getValue());
          termId++;
          if (hasMore2 = lexInStream2.hasNext()) lee2 = lexInStream2.next();
        } else {
          lee1.getValue().setTermId(termId);
          lee1.getValue().setPointer(p);
View Full Code Here

          if (hasMore2 = lexInStream2.hasNext()) lee2 = lexInStream2.next();
        } else {
          lee1.getValue().setTermId(termId);
          lee1.getValue().setPointer(p);
          lee1.getValue().add(lee2.getValue());
          lexOutStream.writeNextEntry(term1, lee1.getValue());
          if (hasMore1 = lexInStream1.hasNext()) lee1 = lexInStream1.next();
          if (hasMore2 = lexInStream2.hasNext()) lee2 = lexInStream2.next();
          termId++;
        }
      }
View Full Code Here

     
      if (hasMore1) {
        while (hasMore1) {
          lee1.getValue().setTermId(termId);
          lee1.getValue().setPointer(p);
          lexOutStream.writeNextEntry(lee1.getKey(), lee1.getValue());
          if (hasMore1 = lexInStream1.hasNext()) lee1 = lexInStream1.next();
          termId++;
        }
      } else if (hasMore2) {
        while (hasMore2) {
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.