Character frequency analysis could identify these posts too, I suppose. A post with this high % of "j" and this low % of "a" (namely zero) can't be a meaningful text.
I wonder if there's some data on reasonable bounds for frequencies of each letter...
2015-01-17 03:26:29.229707 UTC
TypeError: 'bool' object is not iterable
Traceback (most recent call last):
File "ws.py", line 72, in <module>
is_spam, reason = check_if_spam_json(a)
TypeError: 'bool' object is not iterable
But I think the first change was also needed, because (to my poor understanding) return make have been taking only one value from the iterator given by check_if_spam -- no more were explicitly requested.
@Fundamental Ahh... you're right, it actually is related. We expect message content to be passed to the bayesian_learn function, but we actually pass a title. I'll fix that.
@ProgramFOX It should work now after I fixed it (before, it checked in check_if_spam, but it never did in handle_spam. Not sure if it would have still posted or not)
@hichris123 No, it never checked in handle_spam, but handle_spam was never executed if check_if_spam didn't return true, so I don't think that makes a difference.