it.unimi.dsi.mg4j.search.score
Class ClarkeCormackScorer

java.lang.Object
  extended byit.unimi.dsi.mg4j.search.score.AbstractScorer
      extended byit.unimi.dsi.mg4j.search.score.ClarkeCormackScorer
All Implemented Interfaces:
Scorer

public class ClarkeCormackScorer
extends AbstractScorer

Computes the Clarke-Cormack score of all interval iterators of a document. This score function is defined in Shortest-Substring Retrieval and Ranking (ACM Transactions on Information Systems, vol. 18, no. 1, Jan 2000, pages 44-78), at page 65; the weight assigned to different indices is the same for all indices (but it may be rewritten by subclasses, rewriting the AbstractScorer.weight(Index) method).

The score depends on two parameters: an integer h and a double alpha. The score is obtained summing up a certain score assigned to all intervals in the interval iterator produced on that document for the given query. The score assigned to an interval is 1 if the interval has length smaller than h; otherwise, it is obtained by dividing h by the interval length, and raising the result to the power of alpha.

Note that the score assigned to each interval is between 0 and 1 (highest scores corresponding to best intervals). The score assigned to an interval iterator is thus bounded from above by the number of intervals.

Typically, one sets h=16 (or a bit larger) and alpha=1 (or a bit smaller), but the authors say that the method is rather stable w.r.t. changes in the values of parameters.


Constructor Summary
ClarkeCormackScorer()
          Default constructor, assigning the default values (h=16, alpha=1) to the parameter.
ClarkeCormackScorer(int h, double alpha)
          Creates a scorer with given parameter.
 
Method Summary
protected  double score(IntervalIterator it)
          Computes the Clarke-Cormack score of an interval iterator.
 
Methods inherited from class it.unimi.dsi.mg4j.search.score.AbstractScorer
score, scoredDocumentIterator, weight
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClarkeCormackScorer

public ClarkeCormackScorer(int h,
                           double alpha)
Creates a scorer with given parameter.

Parameters:
h - the parameter h.
alpha - the parameter alpha.

ClarkeCormackScorer

public ClarkeCormackScorer()
Default constructor, assigning the default values (h=16, alpha=1) to the parameter.

Method Detail

score

protected double score(IntervalIterator it)
Computes the Clarke-Cormack score of an interval iterator.

Specified by:
score in class AbstractScorer
Parameters:
it - the iterator.
Returns:
the score.