from string import punctuation

def wf(fn):
    "Make a dictionary of word frequencies"
    count = { }
    for line in open(fn):
        for w in tokenize(line):
            count.setdefault(w, 0)
            count[w] += 1
    return count

def tokenize(s):
    "Return the list of words in string s"
    a = [ ]
    for x in s.split():
        a.append( x.strip(punctuation).lower() )
    return a
