I wanted to have some Bayesian fun in a user-script, so did a quick JavaScript port of the fabulous Divmod Reverend Python module.
It's somewhat limited, but dead easy to use:
var guesser = new Bayes();
guesser.train("hannibal", "I love to kill people and eat them.");
guesser.train("austen", "Come, let us have tea and scones in Mr. Bingley's gazebo.");
guesser.guess("Jane, these scones are simply delightful!");
// [["austen", 0.9999]]
guesser.train("hannibal", "I love to kill people and eat them with tea and scones.");
guesser.guess("Give me those scones or I'll kill and eat you.");
// [["hannibal", 0.9481433307479079], ["austen", 0.6203339133520634]]
It's missing some stuff, but does enough to be getting along with.
As a test application, I went on and wrote up one of the examples given in the Reverend docs: a script to tell whether you write more like Charles Dickens or Jane Austen. It's both pointless and inaccurate, but I suppose it qualifies. :)