|
|||||||||
| 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.DocumentRankScorer
public class DocumentRankScorer
Compute scores that do not depend on intervals, but that just assign a fixed score to each document; scores are read from a file whose name is passed to the constructor.
| Field Summary |
|---|
| Fields inherited from class it.unimi.di.mg4j.search.score.AbstractScorer |
|---|
documentIterator, indexIterator |
| Constructor Summary | |
|---|---|
DocumentRankScorer(double[] score)
Builds a document scorer with given scores. |
|
DocumentRankScorer(String filename)
Builds a document scorer by reading the ranks from a file. |
|
DocumentRankScorer(String filename,
String type)
Builds a document scorer by reading the ranks from a file of specified type. |
|
DocumentRankScorer(String filename,
String type,
boolean gzip)
Builds a document scorer by reading the ranks from a file of specified type. |
|
DocumentRankScorer(String filename,
String type,
String gzip)
Builds a document scorer by reading the ranks from a file of specified type. |
|
| Method Summary | |
|---|---|
DocumentRankScorer |
copy()
|
double |
score()
Returns a score for the current document of the last document iterator given to Scorer.wrap(DocumentIterator). |
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). |
String |
toString()
|
boolean |
usesIntervals()
Whether this scorer uses intervals. |
| Methods inherited from class it.unimi.di.mg4j.search.score.AbstractScorer |
|---|
getWeights, nextDocument, setWeights, wrap |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface it.unimi.di.mg4j.search.score.Scorer |
|---|
getWeights, nextDocument, setWeights, wrap |
| Constructor Detail |
|---|
public DocumentRankScorer(String filename)
throws IOException
This constructor can be used with an ObjectParser.
filename - the name of the rank file.
IOException
public DocumentRankScorer(String filename,
String type,
String gzip)
throws IOException
This constructor has the same arguments as DocumentRankScorer(String, String, boolean),
but it can be used with an ObjectParser.
filename - the name of the rank file.type - one of int, long, float or double.gzip - a boolean specifying whether the file is gzip'd.
IOExceptionDocumentRankScorer(String)
public DocumentRankScorer(String filename,
String type)
throws IOException
This constructor can be used with an ObjectParser.
filename - the name of the rank file.type - one of int, long, float or double.
IOExceptionDocumentRankScorer(String)
public DocumentRankScorer(String filename,
String type,
boolean gzip)
throws IOException
filename - the name of the rank file.type - one of int, long, float or double.gzip - whether the file is gzip'd.
IOExceptionDocumentRankScorer(String)public DocumentRankScorer(double[] score)
score - the scores (they are not copied, so the caller is supposed
not to change their values).| Method Detail |
|---|
public DocumentRankScorer copy()
copy in interface DelegatingScorercopy in interface Scorercopy in interface FlyweightPrototype<Scorer>public double score()
ScorerScorer.wrap(DocumentIterator).
score in interface Scorerpublic 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 String toString()
toString in class Objectpublic 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 | ||||||||