@Override
    public double rank(Corpus corpus, TextTerms doc, String term, int tf, int n) {
        if (tf <= 0) return 0.0;

        int N = corpus.ndoc();
        int docSize = doc.size();
        int avgDocSize = corpus.avgDocSize();

        return score(tf, docSize, avgDocSize, N, n);
    }
@Test
    public void testRank() {
        System.out.println("rank");
        int freq = 3;
        int docSize = 100;
        int avgDocSize = 150;
        int N = 10000000;
        int n = 1000;
        BM25 instance = new BM25(2.0, 0.75, 0.0);
        double expResult = 18.419681;
        double result = instance.score(freq, docSize, avgDocSize, N, n);
        assertEquals(expResult, result, 1E-6);
    }