mirror of
https://github.com/rspeer/wordfreq.git
synced 2024-12-24 18:01:38 +00:00
generated freq dict in place
This commit is contained in:
parent
e37c689031
commit
d988b1b42e
@ -47,9 +47,10 @@ def read_freqs(filename, cutoff=0):
|
|||||||
# duplicates, it does the right thing
|
# duplicates, it does the right thing
|
||||||
raw_counts[token] += val
|
raw_counts[token] += val
|
||||||
|
|
||||||
freqs = {key: raw_count / total
|
for word in raw_counts:
|
||||||
for (key, raw_count) in raw_counts.items()}
|
raw_counts[word] /= total
|
||||||
return freqs
|
|
||||||
|
return raw_counts
|
||||||
|
|
||||||
|
|
||||||
def freqs_to_cBpack(in_filename, out_filename, cutoff=-600):
|
def freqs_to_cBpack(in_filename, out_filename, cutoff=-600):
|
||||||
|
Loading…
Reference in New Issue
Block a user