net.sf.classifier4J.bayesian
Class SimpleWordsDataSource

java.lang.Object
  |
  +--net.sf.classifier4J.bayesian.SimpleWordsDataSource
All Implemented Interfaces:
IWordsDataSource, java.io.Serializable

public class SimpleWordsDataSource
extends java.lang.Object
implements IWordsDataSource, java.io.Serializable

Author:
Nick Lothian, Peter Leschev
See Also:
Serialized Form

Constructor Summary
SimpleWordsDataSource()
           
 
Method Summary
 void addMatch(java.lang.String word)
          Add a matching word to the data source
 void addNonMatch(java.lang.String word)
          Add a non-matching word to the data source
 java.util.Collection getAll()
           
 WordProbability getWordProbability(java.lang.String word)
           
 void setWordProbability(WordProbability wp)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleWordsDataSource

public SimpleWordsDataSource()
Method Detail

setWordProbability

public void setWordProbability(WordProbability wp)

getWordProbability

public WordProbability getWordProbability(java.lang.String word)
Specified by:
getWordProbability in interface IWordsDataSource
Parameters:
word - The word to calculate the probability of
Returns:
The word probability if the word exists, null otherwise;
See Also:
IWordsDataSource.getWordProbability(java.lang.String)

getAll

public java.util.Collection getAll()

addMatch

public void addMatch(java.lang.String word)
Description copied from interface: IWordsDataSource
Add a matching word to the data source

Specified by:
addMatch in interface IWordsDataSource
Parameters:
word - the word that matches
See Also:
IWordsDataSource.addMatch(java.lang.String)

addNonMatch

public void addNonMatch(java.lang.String word)
Description copied from interface: IWordsDataSource
Add a non-matching word to the data source

Specified by:
addNonMatch in interface IWordsDataSource
Parameters:
word - the word that does not match
See Also:
IWordsDataSource.addNonMatch(java.lang.String)


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