A wrapper for a
DocumentIterator returning scored document pointers.
Typically, a scorer may have one or more constructors,
but all scorers should provide a constructor that takes only strings as arguments to
make the instantiation from command-line or similar interfaces easier.
To be (re)used, a scorer must first
an
underlying
it.unimi.dsi.mg4j.search.DocumentIterator . This
phase usually involves some preprocessing around properties of the document iterator to
be scored. After wrapping, calls to
Scorer.nextDocument() and
Scorer.score() (or possibly
Scorer.score(Index) ) will return the next document pointer and
its score. Note that these methods are not usually idempotent, as they modify the state of the underlying iterator
(e.g., they consume intervals).
Scores returned by a scorer might depend on some
associated to each index.
Optionally, a scorer might be a
it.unimi.dsi.mg4j.search.score.DelegatingScorer .
Warning: implementations of this interface are not required
to be thread-safe, but they provide
.
The
Scorer.copy() method is strengthened so to return an object implementing this interface.
|