net.sf.classifier4J.bayesian
Interface IWordsDataSource

All Known Subinterfaces:
ICategorisedWordsDataSource
All Known Implementing Classes:
JDBCWordsDataSource, SimpleWordsDataSource

public interface IWordsDataSource

Interface used by BayesianClassifier to determine the probability of each word.

Author:
Nick Lothian, Peter Leschev

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
 WordProbability getWordProbability(java.lang.String word)
           
 

Method Detail

getWordProbability

public WordProbability getWordProbability(java.lang.String word)
                                   throws WordsDataSourceException
Parameters:
word - The word to calculate the probability of
Returns:
The word probability if the word exists, null otherwise;
Throws:
WordsDataSourceException - If there is a fatal problem. For example, the database is unavailable

addMatch

public void addMatch(java.lang.String word)
              throws WordsDataSourceException
Add a matching word to the data source

Parameters:
word - the word that matches
Throws:
WordsDataSourceException - If there is a fatal problem. For example, the database is unavailable

addNonMatch

public void addNonMatch(java.lang.String word)
                 throws WordsDataSourceException
Add a non-matching word to the data source

Parameters:
word - the word that does not match
Throws:
WordsDataSourceException - If there is a fatal problem. For example, the database is unavailable


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