gr.demokritos.iit.jinsect.classification
Class Decider

java.lang.Object
  extended by gr.demokritos.iit.jinsect.classification.Decider
Direct Known Subclasses:
SVMDecider

public class Decider
extends java.lang.Object

This class gathers data for a set of categories and can then perform classification over documents. The category data can be updated at any point in time.


Field Summary
protected  INSECTDB Repository
          The INSECTDB repository of data used.
 
Constructor Summary
Decider(INSECTDB dbRepository)
          Creates a new instance of Decider, given a repository of data.
 
Method Summary
 void addEvidence(Decision dPrv, java.lang.String sFinalCategory)
          Updates the evidence of the determiner with new data, with respect to a previous decision.
 void addEvidence(SimpleTextDocument dDoc, java.lang.String sFinalCategory)
          Updates the evidence of the determiner with new data, in order to correct erroneous decisions.
protected  java.lang.String filterDataString(java.lang.String sStr, SimpleTextCategory cCat)
          Filters a data string to keep only words concerning a single category
 java.lang.String[] getAvailableCategories()
          Returns an array of the available category names from the repository used in the object.
 void reset()
          Resets categories and all other data of the Decider.
 void setRepository(INSECTDB dbRepository)
          Sets the repository of the Decider data
protected  Decision suggestCategory(SimpleTextDocument dDoc)
          Suggests a category for the given document.
 Decision suggestCategory(java.lang.String sFilename)
          Suggests a category for a given file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Repository

protected INSECTDB Repository
The INSECTDB repository of data used.

Constructor Detail

Decider

public Decider(INSECTDB dbRepository)
Creates a new instance of Decider, given a repository of data.

Parameters:
dbRepository - The repository to use.
Method Detail

setRepository

public void setRepository(INSECTDB dbRepository)
Sets the repository of the Decider data

Parameters:
dbRepository - The repository to use.

suggestCategory

public Decision suggestCategory(java.lang.String sFilename)
Suggests a category for a given file.

Parameters:
sFilename - The path to the file under review.
Returns:
A Decision indicating the suggestion of category for the given file.

suggestCategory

protected Decision suggestCategory(SimpleTextDocument dDoc)
Suggests a category for the given document. Returns a Decision with the info concerning the decision.

Parameters:
dDoc - The document the category of which is to be determined.
Returns:
A Decision indicating the suggestion of category for the given file.

filterDataString

protected java.lang.String filterDataString(java.lang.String sStr,
                                            SimpleTextCategory cCat)
Filters a data string to keep only words concerning a single category

Parameters:
sStr - The string to filter.
cCat - The category to use for filtering.
Returns:
A string including only appropriate words from the original string.

addEvidence

public void addEvidence(SimpleTextDocument dDoc,
                        java.lang.String sFinalCategory)
Updates the evidence of the determiner with new data, in order to correct erroneous decisions.

Parameters:
dDoc - The document.
sFinalCategory - The correct category for the selected document.

addEvidence

public void addEvidence(Decision dPrv,
                        java.lang.String sFinalCategory)
Updates the evidence of the determiner with new data, with respect to a previous decision.

Parameters:
dPrv - The previous decision info.
sFinalCategory - The correct category for the selected document.

getAvailableCategories

public java.lang.String[] getAvailableCategories()
Returns an array of the available category names from the repository used in the object.

Returns:
An array of string category names.

reset

public void reset()
Resets categories and all other data of the Decider.