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
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
cutoff
protected double cutoff
AbstractClassifier
public AbstractClassifier()
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.