Fix CI detected line-length issue

This commit is contained in:
Bob Abeles 2023-10-23 20:35:31 -07:00
parent 2e996587fe
commit 892d89e8b7

View File

@ -222,7 +222,7 @@ def compute_huffman_coding(qstrs, translation_name, translations, f, compression
f"Translation {translation_name} expected to fit in 8 bits but required 16 bits"
)
# Prune the qstrs to only those longer than 3 characters that appear in the texts
# Prune the qstrs to only those that appear in the texts
qstr_counters = collections.Counter()
qstr_extractor = TextSplitter(qstr_strs)
for t in texts:
@ -302,7 +302,9 @@ def compute_huffman_coding(qstrs, translation_name, translations, f, compression
# The set of candidates is pruned by estimating their relative value and
# picking to top 100 scores.
counter = sorted(counter.items(), key=lambda x: math.log(x[1]) * len(x[0]), reverse=True)[:100]
counter = sorted(
counter.items(), key=lambda x: math.log(x[1]) * len(x[0]), reverse=True
)[:100]
scores = sorted(
((s, -est_net_savings(s, occ)) for (s, occ) in counter if occ > 1),
key=lambda x: x[1],