net.sf.classifier4J
Class AbstractClassifier

java.lang.Object
  |
  +--net.sf.classifier4J.AbstractClassifier
All Implemented Interfaces:
IClassifier
Direct Known Subclasses:
AbstractCategorizedTrainableClassifier, SimpleClassifier

public abstract class AbstractClassifier
extends java.lang.Object
implements IClassifier

Implementaion of the IClassifier.setMatchCutoff(double) and IClassifier.isMatch(java.lang.String) methods.

Author:
Nick Lothian

Field Summary
protected  double cutoff
           
 
Fields inherited from interface net.sf.classifier4J.IClassifier
DEFAULT_CUTOFF, LOWER_BOUND, NEUTRAL_PROBABILITY, UPPER_BOUND
 
Constructor Summary
AbstractClassifier()
           
 
Method Summary
 double getMatchCutoff()
           
 boolean isMatch(double matchProbability)
          Convenience method which takes a match probability (calculated by IClassifier.classify(java.lang.String)) and checks if it would be classified as a match or not
 boolean isMatch(java.lang.String input)
          Implementation of IClassifier.isMatch(java.lang.String) method.
 void setMatchCutoff(double cutoff)
          This implementation throws an IllegalArgumentException if cutoff is greater than 1 or less than 0.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.classifier4J.IClassifier
classify
 

Field Detail

cutoff

protected double cutoff
Constructor Detail

AbstractClassifier

public AbstractClassifier()
Method Detail

setMatchCutoff

public void setMatchCutoff(double cutoff)

This implementation throws an IllegalArgumentException if cutoff is greater than 1 or less than 0.

Specified by:
setMatchCutoff in interface IClassifier
Parameters:
cutoff - Used to determine the mimimum probability that should be classified as a match
Throws:
java.lang.IllegalArgumentException - if if cutoff is greater than 1 or less than 0

getMatchCutoff

public double getMatchCutoff()

isMatch

public boolean isMatch(java.lang.String input)
                throws ClassifierException

Implementation of IClassifier.isMatch(java.lang.String) method.

Specified by:
isMatch in interface IClassifier
Parameters:
input - the string to classify
Returns:
true if the input string has a probability >= the cutoff probability of matching
Throws:
ClassifierException - If a non-recoverable problem occurs
See Also:
IClassifier.isMatch(java.lang.String)

isMatch

public boolean isMatch(double matchProbability)
Description copied from interface: IClassifier
Convenience method which takes a match probability (calculated by IClassifier.classify(java.lang.String)) and checks if it would be classified as a match or not

Specified by:
isMatch in interface IClassifier
Parameters:
matchProbability -
Returns:
true if match, false otherwise
See Also:
IClassifier.isMatch(double)


Copyright © 2003-2005 Nick Lothian. All Rights Reserved.