# HW#4 # Comparative Analysis of Two Corpora: # EFL Writing by Bulgarian and Japanese Students # Part A: Induce a vocabulary frequency ranking from the Brown Corpus import pickle # [STEP 1] Read in brown_freq.txt file. # Process it to build a frequency dictionary called brown_freq. # YOUR CODE BELOW: brown_freq = {} # [STEP 2a] Complete getRank() function. Study the hints. def getRank(freq) : """Takes a dictionary, likely a frequency dictionary, returns another dictionary where the value is the rank in the order of decreasing value.""" rank = {} # YOUR CODE BELOW: return rank # [STEP 2b] Produce brown_vocab_rank by feeding brown_freq into getRank(). # UNCOMMENT THE LINE BELOW: # brown_vocab_rank = getRank(brown_freq) # [STEP 3] Pickle brown_vocab_rank. Use the binary protocol. # YOUR CODE BELOW: