private PriorityQueue<USField> createQueue(String fieldName,Map<String,Flt> words) throws IOException {
  int numDocs=ir.numDocs();
  FreqQ res=new FreqQ(words.size());
  for (  String word : words.keySet()) {
    float tf=words.get(word).x;
    if (minTermFreq > 0 && tf < minTermFreq) {
      continue;
    }
    int docFreq=ir.docFreq(new Term(fieldName,word));
    if (minDocFreq > 0 && docFreq < minDocFreq) {
      continue;
    }
    if (docFreq == 0 || docFreq > maxDocFreq) {
      continue;
    }
    float idf=similarity.idf(docFreq,numDocs);
    float score=0;
    if (isLogTf()) {
      score=(float)(Math.log(tf + 1) * idf);
    }
 else {
      score=tf * idf;
    }
    USField mltField;
    if (isPayloadField(fieldName)) {
      mltField=new USField(word,fieldName,score,tf,idf,docFreq,1.01f);
    }
 else {
      mltField=new USField(word,fieldName,score,tf,idf,docFreq);
    }
    res.insertWithOverflow(mltField);
  }
  return res;
}

private PriorityQueue < USField > createQueue ( String fieldName , Map < String , Flt > words ) throws IOException { int numDocs = ir . numDocs ( ) ; FreqQ res = new FreqQ ( words . size ( ) ) ; for ( String word : words . keySet ( ) ) { float tf = words . get ( word ) . x ; if ( minTermFreq > 0 && tf < minTermFreq ) { continue ; } int docFreq = ir . docFreq ( new Term ( fieldName , word ) ) ; if ( minDocFreq > 0 && docFreq < minDocFreq ) { continue ; } if ( docFreq == 0 || docFreq > maxDocFreq ) { continue ; } float idf = similarity . idf ( docFreq , numDocs ) ; float score = 0 ; if ( isLogTf ( ) ) { score = ( float ) ( Math . log ( tf + 1 ) * idf ) ; } else { score = tf * idf ; } USField mltField ; if ( isPayloadField ( fieldName ) ) { mltField = new USField ( word , fieldName , score , tf , idf , docFreq , 1.01f ) ; } else { mltField = new USField ( word , fieldName , score , tf , idf , docFreq ) ; } res . insertWithOverflow ( mltField ) ; } return res ; }
create a priorityqueue from a word - > tf map .
