to one or more classes or categories making it easier to manage or sort. require 'stuff-classifier' cls = StuffClassifier::TfIdf.new("Cats or Dogs") cls.ignore_words = [ 'the', 'my', 'i', 'dont' ] cls.train(:dog, "Dogs are awesome, cats too. I love my dog") cls.train(:cat, "Cats are more preferred by software developers. I never could stand cats. I have a dog") cls.train(:dog, "My dog's name is Willy. He likes to play with my wife's cat all day long. I love dogs") cls.train(:cat, "Cats are difficult animals, unlike dogs, really annoying, I hate them all") cls.train(:dog, "So which one should you choose? A dog, definitely.") cls.train(:cat, "The favorite food for cats is bird meat, although mice are good, but birds are a delicacy") cls.train(:dog, "A dog will eat anything, including birds or whatever meat") cls.train(:cat, "My cat's favorite place to purr is on my keyboard") cls.train(:dog, "My dog's favorite place to take a leak is the tree in front of our house") cls.classify("This test is about cats.") #=> :cat