Python port/adaptation of Edwin Chen's Ruby Naive Bayes classifer (http://goo.gl/uLmBf)