@Test public void testRank() { System.out.println("rank"); int freq = 3; int maxFreq = 10; int N = 10000000; int n = 1000; TFIDF instance = new TFIDF(); double expResult = 5.341997; double result = instance.rank(freq, maxFreq, N, n); assertEquals(expResult, result, 1E-6); }
public double rank(int tf, int maxtf, long N, long n) { if (tf == 0) return 0.0; return (a + (1-a) * tf / maxtf) * Math.log((double) N / n); }
TFIDF implements RelevanceRanker { public double rank(int tf, int maxtf, long N, long n) { if (tf == 0) return 0.0; return (a + (1-a) * tf / maxtf) * Math.log((double) N / n); } }
TFIDF implements RelevanceRanker { public double rank(int tf, int maxtf, long N, long n) { if (tf == 0) return 0.0; return (a + (1-a) * tf / maxtf) * Math.log((double) N / n); } TFIDF();  TFIDF(double smoothing); }
TFIDF implements RelevanceRanker { public double rank(int tf, int maxtf, long N, long n) { if (tf == 0) return 0.0; return (a + (1-a) * tf / maxtf) * Math.log((double) N / n); } TFIDF();  TFIDF(double smoothing); double rank(int tf, int maxtf, long N, long n); @Override double rank(Corpus corpus, TextTerms doc, String term, int tf, int n); @Override double rank(Corpus corpus, TextTerms doc, String[] terms, int[] tf, int n); }
TFIDF implements RelevanceRanker { public double rank(int tf, int maxtf, long N, long n) { if (tf == 0) return 0.0; return (a + (1-a) * tf / maxtf) * Math.log((double) N / n); } TFIDF();  TFIDF(double smoothing); double rank(int tf, int maxtf, long N, long n); @Override double rank(Corpus corpus, TextTerms doc, String term, int tf, int n); @Override double rank(Corpus corpus, TextTerms doc, String[] terms, int[] tf, int n);  }