it.unimi.di.mg4j.search.score
Class VignaScorer
java.lang.Object
it.unimi.di.mg4j.search.score.AbstractScorer
it.unimi.di.mg4j.search.score.AbstractWeightedScorer
it.unimi.di.mg4j.search.score.VignaScorer
- All Implemented Interfaces:
- DelegatingScorer, Scorer, FlyweightPrototype<Scorer>
public class VignaScorer
- extends AbstractWeightedScorer
- implements DelegatingScorer
Computes the Vigna score of all interval iterators of a document.
This scorer progressively moves score from a residual (initialised to 1)
to the current score (initialised to 0). For each interval, we move a fraction of the residual
equal to the ratio of the extent
over the interval length, minimised with 1 and divided by 2. For instance,
on a two-term query meeting intervals of length 2 will increase the score from 0 to 1/2, 3/4 and so on.
On the other hand, larger intervals take away less from the residual.
When the score exceeds .99, the computation is interrupted. In this way, we exploit
the laziness of the algorithms for minimal-interval
semantics implemented in it.unimi.di.mg4j.search
, greatly improving performance for
extremely frequent terms, with no perceivable effect on the score itself.
VignaScorer
public VignaScorer()
score
public double score(Index index)
throws IOException
- Description copied from interface:
Scorer
- Returns a score for the current document of the last document iterator
given to
Scorer.wrap(DocumentIterator)
, but
considering only a given index (optional operation).
- Specified by:
score
in interface Scorer
- Parameters:
index
- the only index to be considered.
- Returns:
- the score.
- Throws:
IOException
toString
public String toString()
- Overrides:
toString
in class Object
copy
public VignaScorer copy()
- Specified by:
copy
in interface DelegatingScorer
- Specified by:
copy
in interface Scorer
- Specified by:
copy
in interface FlyweightPrototype<Scorer>
usesIntervals
public boolean usesIntervals()
- Returns true.
- Specified by:
usesIntervals
in interface Scorer
- Returns:
- true.