net.sf.classifier4J.bayesian
Interface ICategorisedWordsDataSource

All Superinterfaces:
IWordsDataSource
All Known Implementing Classes:
JDBCWordsDataSource

public interface ICategorisedWordsDataSource
extends IWordsDataSource

Interface used by BayesianClassifier to determine the probability of each word based on a particular category.

Author:
Nick Lothian, Peter Leschev

Method Summary
 void addMatch(java.lang.String category, java.lang.String word)
          Add a matching word to the data source
 void addNonMatch(java.lang.String category, java.lang.String word)
          Add a non-matching word to the data source
 WordProbability getWordProbability(java.lang.String category, java.lang.String word)
           
 
Methods inherited from interface net.sf.classifier4J.bayesian.IWordsDataSource
addMatch, addNonMatch, getWordProbability
 

Method Detail

getWordProbability

public WordProbability getWordProbability(java.lang.String category,
                                          java.lang.String word)
                                   throws WordsDataSourceException
Parameters:
category - the category to check against
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 category,
                     java.lang.String word)
              throws WordsDataSourceException
Add a matching word to the data source

Parameters:
category - the category add the match to
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 category,
                        java.lang.String word)
                 throws WordsDataSourceException
Add a non-matching word to the data source

Parameters:
category - the category add the non-match to
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.