This Text file is old! In a 🏛️Museum, an unsorted archive of (user-)pages. (Saved from Geocities in Oct-2009. The archival story: oocities.org)
--------------------------------------- (To 🚫report any bad content: archivehelp @ gmail.com)
>


# loadwordcounts - 
# loads the corpus wordcounts out of a plain text file with 
# fields delimited with a colon into a dictionary

import string

def load_corpus_wordcounts(filename):
    infile = open(filename,'r')
    wc = {}
    for line in infile.readlines():
        row = string.split(string.strip(line),':')
        if len(row) == 2:
           wc[row[0]] = row[1]
    infile.close()
    return wc




file = "c:\\python20\\balzacwords.txt"
wc = load_corpus_wordcounts(file)
print wc
      

Text file Source (historic): geocities.com/soho/square/3472

geocities.com/soho/square
geocities.com/soho

(to report bad content: archivehelp @ gmail)