Merge pull request #3298 from ciscorn/huffman-src

Calculate the Huffman codebook without MP_QSTRs
This commit is contained in:
Jeff Epler 2020-08-18 10:58:23 -05:00 committed by GitHub
commit 6136ca38d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -102,10 +102,6 @@ def translate(translation_file, i18ns):
def compute_huffman_coding(translations, qstrs, compression_filename):
all_strings = [x[1] for x in translations]
# go through each qstr and print it out
for _, _, qstr in qstrs.values():
all_strings.append(qstr)
all_strings_concat = "".join(all_strings)
counts = collections.Counter(all_strings_concat)
cb = huffman.codebook(counts.items())