org.imemex.queryprocessor.scoring.rules
Class AbstractScoringRule<E extends IdentifiableResourceView>

java.lang.Object
  extended by org.imemex.queryprocessor.scoring.rules.AbstractScoringRule<E>
All Implemented Interfaces:
ScoringRule<E>
Direct Known Subclasses:
Proximity, ScoreAllComponents, ScoreContentComponent, ScoreFileExtension, ScoreFileSize, ScoreLastModified, ScoreLucene, ScoreNameComponent, ScoreRelaxation, ScoreTupleAttribute, ScoreTupleComponent

public abstract class AbstractScoringRule<E extends IdentifiableResourceView>
extends java.lang.Object
implements ScoringRule<E>

Provides an abstract implementation of a scoring rule. The score variable, range is 0 to 1, indicates how good a rule matches a RV.

Author:
jaeggir

Constructor Summary
AbstractScoringRule()
          Default constructor.
AbstractScoringRule(double w)
          This constructor sets points to p.
 
Method Summary
 double getWeight()
          return maximum possible score
 void setWeight(double w)
          set maximum possible score to a new value.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.imemex.queryprocessor.scoring.ScoringRule
computeScore, getRuleDesc
 

Constructor Detail

AbstractScoringRule

public AbstractScoringRule()
Default constructor. Sets points to 0 and weight to 1.


AbstractScoringRule

public AbstractScoringRule(double w)
This constructor sets points to p.

Parameters:
p - - new value for weight
Method Detail

getWeight

public double getWeight()
Description copied from interface: ScoringRule
return maximum possible score

Specified by:
getWeight in interface ScoringRule<E extends IdentifiableResourceView>
Returns:
maximum possible score

setWeight

public void setWeight(double w)
Description copied from interface: ScoringRule
set maximum possible score to a new value. A normal rule gives at most 1 scoring point.

Specified by:
setWeight in interface ScoringRule<E extends IdentifiableResourceView>