net.sf.classifier4J.bayesian
Class JDBMWordsDataSource

java.lang.Object
  |
  +--net.sf.classifier4J.bayesian.JDBMWordsDataSource
All Implemented Interfaces:
net.sf.classifier4J.bayesian.ICategorisedWordsDataSource, net.sf.classifier4J.bayesian.IWordsDataSource

public class JDBMWordsDataSource
extends java.lang.Object
implements net.sf.classifier4J.bayesian.ICategorisedWordsDataSource


Constructor Summary
JDBMWordsDataSource()
           
JDBMWordsDataSource(java.lang.String directory)
           
 
Method Summary
 void addMatch(java.lang.String word)
           
 void addMatch(java.lang.String category, java.lang.String word)
           
 void addNonMatch(java.lang.String word)
           
 void addNonMatch(java.lang.String category, java.lang.String word)
           
 void close()
           
protected  void finalize()
           
protected  java.lang.String getKey(java.lang.String category, java.lang.String word)
           
 net.sf.classifier4J.bayesian.WordProbability getWordProbability(java.lang.String word)
           
 net.sf.classifier4J.bayesian.WordProbability getWordProbability(java.lang.String category, java.lang.String word)
           
 void open()
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDBMWordsDataSource

public JDBMWordsDataSource()

JDBMWordsDataSource

public JDBMWordsDataSource(java.lang.String directory)
Method Detail

close

public void close()

open

public void open()
          throws java.io.IOException
java.io.IOException

addMatch

public void addMatch(java.lang.String word)
Specified by:
addMatch in interface net.sf.classifier4J.bayesian.IWordsDataSource
See Also:
IWordsDataSource.addMatch(java.lang.String)

addNonMatch

public void addNonMatch(java.lang.String word)
Specified by:
addNonMatch in interface net.sf.classifier4J.bayesian.IWordsDataSource
See Also:
IWordsDataSource.addNonMatch(java.lang.String)

addMatch

public void addMatch(java.lang.String category,
                     java.lang.String word)
Specified by:
addMatch in interface net.sf.classifier4J.bayesian.ICategorisedWordsDataSource
See Also:
ICategorisedWordsDataSource.addMatch(java.lang.String, java.lang.String)

addNonMatch

public void addNonMatch(java.lang.String category,
                        java.lang.String word)
Specified by:
addNonMatch in interface net.sf.classifier4J.bayesian.ICategorisedWordsDataSource
See Also:
ICategorisedWordsDataSource.addNonMatch(java.lang.String, java.lang.String)

getWordProbability

public net.sf.classifier4J.bayesian.WordProbability getWordProbability(java.lang.String word)
Specified by:
getWordProbability in interface net.sf.classifier4J.bayesian.IWordsDataSource
See Also:
IWordsDataSource.getWordProbability(java.lang.String)

getWordProbability

public net.sf.classifier4J.bayesian.WordProbability getWordProbability(java.lang.String category,
                                                                       java.lang.String word)
Specified by:
getWordProbability in interface net.sf.classifier4J.bayesian.ICategorisedWordsDataSource
See Also:
ICategorisedWordsDataSource.getWordProbability(java.lang.String, java.lang.String)

getKey

protected java.lang.String getKey(java.lang.String category,
                                  java.lang.String word)
                           throws java.lang.IllegalArgumentException
Parameters:
category - The category, or null for the default
word - The word, cannot be null
Returns:
the key for the category and word. By default this is "category : word"
Throws:
java.lang.IllegalArgumentException - if word is null

finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object
java.lang.Throwable


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