Package it.unimi.dsi.fastutil.longs

Examples of it.unimi.dsi.fastutil.longs.Long2LongRBTreeMap


                  "The number of returned documents (%d) is inferior to the number of documents (%d) for blind RF",
                  results.size(), k));
        }

        // --- Compute the frequencies of terms
        Long2LongRBTreeMap relFreq = computeTermFrequencies(results);

        // --- Select the candidates
        for (Long2LongMap.Entry entry : relFreq.long2LongEntrySet()) {
          long rt2 = entry.getLongValue();
          int nt = frequencies.getInt(entry.getLongKey());
          final double termScore = rt2 * (logN - log(nt))
              - combinaisons[(int)(rt2 - 1)] - logV;
          if (termScore > c) {
View Full Code Here


       * @throws java.io.IOException
       */
      private Long2LongRBTreeMap computeTermFrequencies(
                    ObjectArrayList<DocumentScoreInfo<Reference2ObjectMap<Index, SelectedInterval[]>>> results)
          throws IOException {
        Long2LongRBTreeMap relFreq = new Long2LongRBTreeMap();
        relFreq.defaultReturnValue(0);

        for (int i = 0; i < min(k, results.size()); i++) {
          Document document = collection
              .document(results.get(i).document);
          Reader reader = (Reader) document.content(fieldIndex);
          WordReader wordReader = document.wordReader(fieldIndex);
          wordReader.setReader(reader);

          MutableString word = new MutableString();
          MutableString nonWord = new MutableString();
          final LongRBTreeSet set = new LongRBTreeSet();

          while (wordReader.next(word, nonWord)) {
            if (processor.processTerm(word)) {
              long termId = index.getTermId(word);
              if (termId >= 0)
                if (set.add(termId))
                  relFreq
                      .put(termId,
                          relFreq.get(termId) + 1);
            }
          }

          document.close();

View Full Code Here

TOP

Related Classes of it.unimi.dsi.fastutil.longs.Long2LongRBTreeMap

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.