Classes for assigning scores to documents.
A {@link it.unimi.di.mg4j.search.score.Scorer} is an object that wraps an underlying {@link it.unimi.di.mg4j.search.DocumentIterator} and assigns scores to the documents returned by the underlying iterator. In general, once a scorer has {@linkplain it.unimi.di.mg4j.search.score.Scorer#wrap(it.unimi.di.mg4j.search.DocumentIterator) wrapped a document iterator} one just calls {@link it.unimi.dsi.fastutil.ints.IntIterator#nextInt() nextInt()} and {@link it.unimi.di.mg4j.search.score.Scorer#score()} to get scored documents (some iterators might support {@linkplain it.unimi.di.mg4j.search.score.Scorer#score(it.unimi.di.mg4j.index.Index) index-restricted scoring}, but this is optional).
If the scorer is a {@link it.unimi.di.mg4j.search.score.DelegatingScorer}, then by contract it just delegates all {@link it.unimi.dsi.fastutil.ints.IntIterator}'s methods to the underlying iterator. In this case, it is possible to advance manually the underlying iterator and call {@link it.unimi.di.mg4j.search.score.Scorer#score()}. While this behaviour is useless for general users, it is essential for {@linkplain it.unimi.di.mg4j.search.score.AbstractAggregator aggregated scorers}, which combine several delegating scorers and provide services such as equalisation and interval caching (in case more than one component scorer uses intervals). See, for instance, {@link it.unimi.di.mg4j.search.score.LinearAggregator}.
Scorers should provide, whenever possible, constructors accepting exclusively strings. Such constructors makes it possible to create easily instances using the {@link it.unimi.dsi.lang.ObjectParser} conventions, so that instances can be specified on a command line interface.