public void TestClassify()
{
var wds = new SimpleWordsDataSource();
var classifier = new BayesianClassifier(wds);
var sentence = new[] { "This", "is", "a", "sentence", "about", "java" };
Assert.AreEqual(IClassifierConstants.NEUTRAL_PROBABILITY, classifier.Classify(ICategorizedClassifierConstants.DEFAULT_CATEGORY, sentence), 0d);
wds.SetWordProbability(new WordProbability("This", .5d));
wds.SetWordProbability(new WordProbability("is", .5d));
wds.SetWordProbability(new WordProbability("a", .5d));
wds.SetWordProbability(new WordProbability("sentence", .2d));
wds.SetWordProbability(new WordProbability("about", .5d));
wds.SetWordProbability(new WordProbability("java", .99d));
Assert.AreEqual(.96d, classifier.Classify(ICategorizedClassifierConstants.DEFAULT_CATEGORY, sentence), .009d);
}