Feed-Normalizer normalizes all RSS Feed formats into a generic class. This allows you to access the same properties from any RSS Feed it parses without worrying about the underlying format of the RSS source.
classifier.train('not spam', 'Can you pick the kids up today?')
#Save classication file so your program can learn
classifier.save('spam_or_no_spam.yml')
#Guess if an email is spam or not
guess = classifier.guess('How would you like a free sample of viagra?')
require 'rubygems' require 'bishop'
#Initialize the classifier classifier = Bishop::Bayes.new classifier.load('spam_or_no_spam.yml') if File.file?('spam_or_no_spam.yml')
#Train the classifier to recognize spam email classifier.train('spam', 'Amazing results in a few weeks!') classifier.train('spam', 'Get your free viagra!') classifier.train('spam', 'A credit card offer!')
#Train the classifier to recognize legit email classifier.train('not spam', 'Your payment update') classifier.train('not spam', 'Scheduled Maintenance Reminder') classifier.train('not spam', 'Can you pick the kids up today?')
#Save classication file so your program can learn classifier.save('spam_or_no_spam.yml')
#Guess if an email is spam or not guess = classifier.guess('How would you like a free sample of viagra?')
Linguistics
Linguistics is a generic, language-neutral framework for extending Ruby objects with linguistic methods. This is easily one of the coolest gems. There is simply so much you can do with the Linguistics module.