public float weight(int contentLength,int totalTermFreq){
  float numDocs=1 + contentLength / pivot;
  return (k1 + 1) * (float)Math.log(1 + (numDocs + 0.5D) / (totalTermFreq + 0.5D));
}

public float weight ( int contentLength , int totalTermFreq ) { float numDocs = 1 + contentLength / pivot ; return ( k1 + 1 ) * ( float ) Math . log ( 1 + ( numDocs + 0.5D ) / ( totalTermFreq + 0.5D ) ) ; }
computes term importance , given its in - document statistics .
