mirror of
https://github.com/rspeer/wordfreq.git
synced 2024-12-24 09:51:38 +00:00
run cB_to_freq only once per bucket
This commit is contained in:
parent
6a40e63060
commit
5e8ef19321
@ -213,8 +213,9 @@ def get_frequency_dict(lang, wordlist='combined', match_cutoff=30):
|
|||||||
freqs = {}
|
freqs = {}
|
||||||
pack = get_frequency_list(lang, wordlist, match_cutoff)
|
pack = get_frequency_list(lang, wordlist, match_cutoff)
|
||||||
for index, bucket in enumerate(pack):
|
for index, bucket in enumerate(pack):
|
||||||
|
freq = cB_to_freq(-index)
|
||||||
for word in bucket:
|
for word in bucket:
|
||||||
freqs[word] = cB_to_freq(-index)
|
freqs[word] = freq
|
||||||
return freqs
|
return freqs
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user