net.firstpartners.rp.mid.intelligence
Class BasicIntelligence

java.lang.Object
  extended by net.firstpartners.rp.mid.intelligence.BasicIntelligence
All Implemented Interfaces:
IInterestedInFeedback, IInterestedInResultsFilter, IPlugin

public class BasicIntelligence
extends java.lang.Object
implements IInterestedInResultsFilter, IInterestedInFeedback

Basic intelligence to implement filtering

Author:
brownpa

Field Summary
 int countTopDocs
          Number of the documents to be searched (top documents)
(package private) static java.lang.String DELIMITERS
          Default character delimiters
protected  org.apache.log4j.Logger logger
          Logger for this class and subclasses
private  boolean readyForFeedbackCalculation
          Flag to mark that that plugin is ready for feedback calculation
 double weight
          Weight for calculation of the scores for the links
 
Constructor Summary
BasicIntelligence()
          Constructor of the basic intelligence plugin
 
Method Summary
 void acceptFeedback(IFeedback advice)
          Deal with feedback to improve quality of results next time
 ISearchResult filterAndSortSearchResults(ISearchResult someInfo)
          Gives the class a chance to update
 int getCountTopDocs()
           
 double getWeight()
           
 boolean isReadyForFeedbackCalculation()
           
 void onLoad()
          Called by the PluginManager on each plugin when this class is first loaded Read the feedback xml and recalculate the score according to this
 int preferredFilterOrder()
          What order we prefer the filter to be called in.
 void setCountTopDocs(int countTopDocs)
           
 void setReadyForFeedbackCalculation(boolean readyForFeedbackCalculation)
           
 void setWeight(double weight)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DELIMITERS

static final java.lang.String DELIMITERS
Default character delimiters

See Also:
Constant Field Values

logger

protected final org.apache.log4j.Logger logger
Logger for this class and subclasses


readyForFeedbackCalculation

private boolean readyForFeedbackCalculation
Flag to mark that that plugin is ready for feedback calculation


weight

public double weight
Weight for calculation of the scores for the links


countTopDocs

public int countTopDocs
Number of the documents to be searched (top documents)

Constructor Detail

BasicIntelligence

public BasicIntelligence()
Constructor of the basic intelligence plugin

Method Detail

filterAndSortSearchResults

public ISearchResult filterAndSortSearchResults(ISearchResult someInfo)
Gives the class a chance to update

Specified by:
filterAndSortSearchResults in interface IInterestedInResultsFilter
Parameters:
someInfo -
Returns:

preferredFilterOrder

public int preferredFilterOrder()
What order we prefer the filter to be called in. lower number = filter first

Specified by:
preferredFilterOrder in interface IInterestedInResultsFilter
Returns:
int with the preferred filter ord er

acceptFeedback

public void acceptFeedback(IFeedback advice)
Deal with feedback to improve quality of results next time

Specified by:
acceptFeedback in interface IInterestedInFeedback
Parameters:
advice - The feedback event

onLoad

public void onLoad()
            throws RpException
Called by the PluginManager on each plugin when this class is first loaded Read the feedback xml and recalculate the score according to this

Specified by:
onLoad in interface IPlugin
Throws:
RpException

getWeight

public double getWeight()
Returns:
Returns the weight.

setWeight

public void setWeight(double weight)
Parameters:
weight - The weight to set.

getCountTopDocs

public int getCountTopDocs()
Returns:
Returns the countTopDocs.

setCountTopDocs

public void setCountTopDocs(int countTopDocs)
Parameters:
countTopDocs - The countTopDocs to set.

isReadyForFeedbackCalculation

public boolean isReadyForFeedbackCalculation()
Returns:
Returns the readyForFeedbackCalculation.

setReadyForFeedbackCalculation

public void setReadyForFeedbackCalculation(boolean readyForFeedbackCalculation)
Specified by:
setReadyForFeedbackCalculation in interface IInterestedInFeedback
Parameters:
readyForFeedbackCalculation - The readyForFeedbackCalculation to set.