This class can be used to detect spam in text messages using Bayesian techniques. It analyzes the text words in terms of n-grams in a way that is idiom independent. It can be trained to progressively distinguish what is spam and what is not spam by detecting patterns in training samples. Training data is stored in a MySQL database.