|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectit.unimi.di.mg4j.search.score.AbstractScorer
it.unimi.di.mg4j.search.score.AbstractWeightedScorer
it.unimi.di.mg4j.search.score.CountScorer
public class CountScorer
A trivial scorer that computes the score by adding the counts (the number of occurrences within the current document) of each term multiplied by the weight of the relative index. Mainly useful for debugging and testing purposes.
This class uses a CounterCollectionVisitor
and related classes to take into consideration only terms that are actually involved
in the current document.
| Field Summary | |
|---|---|
protected double[] |
indexNumber2Weight
An array parallel to TermCollectionVisitor.indices() containing the current corresponding values in AbstractWeightedScorer.index2Weight;
it is set up by wrap(DocumentIterator). |
| Fields inherited from class it.unimi.di.mg4j.search.score.AbstractWeightedScorer |
|---|
index2Weight |
| Fields inherited from class it.unimi.di.mg4j.search.score.AbstractScorer |
|---|
documentIterator, indexIterator |
| Constructor Summary | |
|---|---|
CountScorer()
|
|
| Method Summary | |
|---|---|
CountScorer |
copy()
|
double |
score()
Computes a score by calling Scorer.score(Index) for
each index in the current document iterator, and adding the weighted results. |
double |
score(Index index)
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). |
boolean |
usesIntervals()
Whether this scorer uses intervals. |
void |
wrap(DocumentIterator d)
Wraps the given document iterator. |
| Methods inherited from class it.unimi.di.mg4j.search.score.AbstractWeightedScorer |
|---|
getWeights, setWeights |
| Methods inherited from class it.unimi.di.mg4j.search.score.AbstractScorer |
|---|
nextDocument |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface it.unimi.di.mg4j.search.score.Scorer |
|---|
getWeights, nextDocument, setWeights |
| Field Detail |
|---|
protected double[] indexNumber2Weight
TermCollectionVisitor.indices() containing the current corresponding values in AbstractWeightedScorer.index2Weight;
it is set up by wrap(DocumentIterator).
| Constructor Detail |
|---|
public CountScorer()
| Method Detail |
|---|
public double score()
throws IOException
AbstractWeightedScorerScorer.score(Index) for
each index in the current document iterator, and adding the weighted results.
score in interface Scorerscore in class AbstractWeightedScorerIOExceptionpublic double score(Index index)
ScorerScorer.wrap(DocumentIterator), but
considering only a given index (optional operation).
score in interface Scorerindex - the only index to be considered.
public void wrap(DocumentIterator d)
throws IOException
AbstractScorerThis method records internally the provided iterator.
wrap in interface Scorerwrap in class AbstractWeightedScorerd - the document iterator that will be used in subsequent calls to
Scorer.score() and Scorer.score(Index).
IOExceptionpublic CountScorer copy()
copy in interface DelegatingScorercopy in interface Scorercopy in interface FlyweightPrototype<Scorer>public boolean usesIntervals()
ScorerThis method is essential when aggregating scorers,
because if several scores need intervals, a CachingDocumentIterator
will be necessary.
usesIntervals in interface Scorer
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||