run cB_to_freq only once per bucket

Former-commit-id: 5e8ef19321
This commit is contained in:
Joshua Chin 2015-07-07 14:55:13 -04:00
parent 512ab79302
commit cec9e23aea

View File

@ -213,8 +213,9 @@ def get_frequency_dict(lang, wordlist='combined', match_cutoff=30):
freqs = {}
pack = get_frequency_list(lang, wordlist, match_cutoff)
for index, bucket in enumerate(pack):
freq = cB_to_freq(-index)
for word in bucket:
freqs[word] = cB_to_freq(-index)
freqs[word] = freq
return freqs