|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Defines an interface for the classification of Strings.
Use the isMatch method if you want true/false matching, or use the classify method if you match probability.
The isMatch method will return a boolean representing if a string matches whatever criteria the implmentation is matching on. In the default implemnetation this is done by calling classify and checking if the returned match probability is greater than or equal to DEFAULT_CUTOFF.
The classify method will return a double value representing the likelyhood that the string passed to it is a match on whatever criteria the implmentation is matching on.
When implementing this class, it is recommended that the classify method should not return the values 1 or 0 except in the cases there the classifier can guarentee that the string is a match doe does not match. For non-absolute matching algorithms LOWER_BOUND and UPPER_BOUND should be used.
AbstractClassifier
Field Summary | |
static double |
DEFAULT_CUTOFF
Default cutoff value used by defautl implmentation of isMatch. |
static double |
LOWER_BOUND
The minimum likelyhood that a string matches |
static double |
NEUTRAL_PROBABILITY
Default value to use if the implementation cannot work out how well a string matches. |
static double |
UPPER_BOUND
The maximum likelyhood that a string matches |
Method Summary | |
double |
classify(java.lang.String input)
Function to determine the probability string matches a criteria. |
boolean |
isMatch(double matchProbability)
Convenience method which takes a match probability (calculated by classify(java.lang.String) )
and checks if it would be classified as a match or not |
boolean |
isMatch(java.lang.String input)
Function to determine if a string matches a criteria. |
void |
setMatchCutoff(double cutoff)
Sets the cutoff below which the input is not considered a match |
Field Detail |
public static final double NEUTRAL_PROBABILITY
public static final double LOWER_BOUND
public static final double UPPER_BOUND
public static final double DEFAULT_CUTOFF
Method Detail |
public void setMatchCutoff(double cutoff)
cutoff
- the level below which isMatch will return false. Should be between 0 and 1.public double classify(java.lang.String input) throws ClassifierException
input
- the string to classify
ClassifierException
- If a non-recoverable problem occurspublic boolean isMatch(java.lang.String input) throws ClassifierException
input
- the string to classify
ClassifierException
- If a non-recoverable problem occurspublic boolean isMatch(double matchProbability)
classify(java.lang.String)
)
and checks if it would be classified as a match or not
matchProbability
-
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |