-# import re, string, random, glob, operator, heapq
import string
import collections
from math import log10
def Pwords(words):
"""The Naive Bayes log probability of a sequence of words.
"""
- return sum(Pw[w] for w in words)
+ return sum(Pw[w.lower()] for w in words)
class Pdist(dict):
"""A probability distribution estimated from counts in datafile.