Methods Summary |
---|
public int | doc() return doc;
|
public org.apache.lucene.search.Explanation | explain(int doc)
Explanation tfExplanation = new Explanation();
skipTo(doc);
float phraseFreq = (doc() == doc) ? freq : 0.0f;
tfExplanation.setValue(getSimilarity().tf(phraseFreq));
tfExplanation.setDescription("tf(phraseFreq=" + phraseFreq + ")");
return tfExplanation;
|
public boolean | next()
if (firstTime) {
more = spans.next();
firstTime = false;
}
return setFreqCurrentDoc();
|
public float | score()
float raw = getSimilarity().tf(freq) * value; // raw score
return raw * Similarity.decodeNorm(norms[doc]); // normalize
|
protected boolean | setFreqCurrentDoc()
if (! more) {
return false;
}
doc = spans.doc();
freq = 0.0f;
while (more && doc == spans.doc()) {
int matchLength = spans.end() - spans.start();
freq += getSimilarity().sloppyFreq(matchLength);
more = spans.next();
}
return more || (freq != 0);
|
public boolean | skipTo(int target)
if (firstTime) {
more = spans.skipTo(target);
firstTime = false;
}
if (! more) {
return false;
}
if (spans.doc() < target) { // setFreqCurrentDoc() leaves spans.doc() ahead
more = spans.skipTo(target);
}
return setFreqCurrentDoc();
|