Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions test/bayes/bayesian_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,15 @@ def test_classification
@classifier.train_uninteresting "here are some bad words, I hate you"
assert_equal 'Uninteresting', @classifier.classify("I hate bad words and you")
end

def test_untrain
@classifier.train_interesting "here are some good words. I hope you love them"
@classifier.train_uninteresting "here are some bad words, I hate you"
@classifier.add_category 'colors'
@classifier.train_colors "red orange green blue seven"
classification_of_bad_data = @classifier.classify "seven"
@classifier.untrain_colors "seven"
classification_after_untrain = @classifier.classify "seven"
assert_not_equal classification_of_bad_data, classification_after_untrain
end
end