From db184716a07039d4c391fd3723611fc316ee8328 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Sat, 12 Sep 2015 04:20:43 +0200 Subject: [PATCH] * Remove test_freqs function --- tests/serialize/test_huffman.py | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/tests/serialize/test_huffman.py b/tests/serialize/test_huffman.py index 677c6dced..0a4953c08 100644 --- a/tests/serialize/test_huffman.py +++ b/tests/serialize/test_huffman.py @@ -104,22 +104,3 @@ def test_vocab(EN): leaf = codec.leaves[i] expected_length += len(code) * numpy.exp(EN.vocab[leaf].prob) assert 8 < expected_length < 15 - - -@pytest.mark.slow -def test_freqs(): - freqs = [] - words = [] - for i, line in enumerate(open('freqs.txt')): - pieces = line.strip().split() - if len(pieces) != 2: - continue - freq, word = pieces - freqs.append(int(freq)) - words.append(word) - total = float(sum(freqs)) - codec = HuffmanCodec(zip(words, freqs)) - expected_length = 0 - for i, code in enumerate(codec.strings): - expected_length += len(code) * (freqs[i] / total) - assert 8 < expected_length < 14