From 3746af13507ca3819008198d3ad815183708b2b6 Mon Sep 17 00:00:00 2001 From: Joshua Chin Date: Thu, 18 Jun 2015 10:32:53 -0400 Subject: [PATCH] updated freqs_to_dBpack docstring --- wordfreq_builder/wordfreq_builder/word_counts.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/wordfreq_builder/wordfreq_builder/word_counts.py b/wordfreq_builder/wordfreq_builder/word_counts.py index 60fd4e7..745e355 100644 --- a/wordfreq_builder/wordfreq_builder/word_counts.py +++ b/wordfreq_builder/wordfreq_builder/word_counts.py @@ -26,7 +26,7 @@ def read_freqs(filename, cutoff=0): Read words and their frequencies from a CSV file. Only words with a frequency greater than `cutoff` are returned. - + If `cutoff` is greater than 0, the csv file must be sorted by frequency in descending order. """ @@ -52,8 +52,11 @@ def read_freqs(filename, cutoff=0): def freqs_to_dBpack(in_filename, out_filename, cutoff=-60): """ - Convert a dictionary of word frequencies to a file in the idiosyncratic - 'dBpack' format. + Convert a csv file of words and their frequencies to a file in the + idiosyncratic 'dBpack' format. + + Only words with a frequency greater than `cutoff` dB will be written to + the new file. """ freq_cutoff = 10 ** (cutoff / 10.) freqs = read_freqs(in_filename, freq_cutoff)