code: public double score(double freq, long N, long n) {
          if (freq <= 0) return 0.0;
  
          double tf = (k1 + 1) * freq / (freq + k1);
          double idf = Math.log((N - n + 0.5) / (n + 0.5));
  
          return (tf + delta) * idf;
      }
docs: Returns a relevance score between a term and a document based on a corpus.
  @param freq normalized term frequency of searching term in the document to rank.
  @param N the number of documents in the corpus.
  @param n the number of documents containing the given term in the corpus;