Simple naive-bayes classifier ported from the original Ruby classifier at oasic/nbayes