net.sf.classifier4J.bayesian
Class WordProbability
java.lang.Object
|
+--net.sf.classifier4J.bayesian.WordProbability
- All Implemented Interfaces:
- java.lang.Comparable, java.io.Serializable
- public class WordProbability
- extends java.lang.Object
- implements java.lang.Comparable, java.io.Serializable
Represents the probability of a particular word. The user of this object
can either:
- Set a specific probability for a particular word or
- Define the matching and non-matching counts for the particular word.
This class then calculates the probability for you.
- Author:
- Nick Lothian, Peter Leschev
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
WordProbability
public WordProbability()
WordProbability
public WordProbability(java.lang.String w)
WordProbability
public WordProbability(java.lang.String c,
java.lang.String w)
WordProbability
public WordProbability(java.lang.String w,
double probability)
WordProbability
public WordProbability(java.lang.String w,
long matchingCount,
long nonMatchingCount)
setWord
public void setWord(java.lang.String w)
setCategory
public void setCategory(java.lang.String category)
setProbability
public void setProbability(double probability)
setMatchingCount
public void setMatchingCount(long matchingCount)
setNonMatchingCount
public void setNonMatchingCount(long nonMatchingCount)
registerMatch
public void registerMatch()
registerNonMatch
public void registerNonMatch()
getProbability
public double getProbability()
- Returns:
getMatchingCount
public long getMatchingCount()
getNonMatchingCount
public long getNonMatchingCount()
getWord
public java.lang.String getWord()
- Returns:
getCategory
public java.lang.String getCategory()
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in class java.lang.Object
compareTo
public int compareTo(java.lang.Object o)
- Specified by:
compareTo
in interface java.lang.Comparable
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class java.lang.Object
Copyright © 2003-2005 Nick Lothian. All Rights Reserved.