it.unimi.dsi.mg4j.search.score
Class AbstractScorer
java.lang.Object
it.unimi.dsi.mg4j.search.score.AbstractScorer
- All Implemented Interfaces:
- Scorer
- Direct Known Subclasses:
- ClarkeCormackScorer
- public abstract class AbstractScorer
- extends Object
- implements Scorer
An abstract implementation of Scorer
that scores a document iterator in such a way that one can make calls to
the score methods and to the intervalIterator methods in any order and
for any number of times. Implementing classes must provide:
Instead of implementing the latter, one may implement a method weight(Index)
that assigns a weight to each index: in that case, the overall score will be computed
as weighted sum.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractScorer
public AbstractScorer()
score
protected abstract double score(IntervalIterator it)
weight
protected double weight(Index index)
score
protected double score(Map m)
scoredDocumentIterator
public ScoredDocumentIterator scoredDocumentIterator(DocumentIterator d)
- Description copied from interface:
Scorer
- Enrich a document iterator with a score method, according to some scoring algorithm.
- Specified by:
scoredDocumentIterator
in interface Scorer
- Parameters:
d
- a document iterator to be scored.
- Returns:
- the scored document iterator.