mirror of
https://github.com/explosion/spaCy.git
synced 2025-05-03 15:23:41 +03:00
Test that huffman codec works with empty freqs dict
This commit is contained in:
parent
15c9b59f0e
commit
99ff8b902f
|
@ -50,6 +50,11 @@ def test1():
|
||||||
assert codec.strings == [c for i, c in py_codes]
|
assert codec.strings == [c for i, c in py_codes]
|
||||||
|
|
||||||
|
|
||||||
|
def test_empty():
|
||||||
|
codec = HuffmanCodec({})
|
||||||
|
assert codec.strings == []
|
||||||
|
|
||||||
|
|
||||||
def test_round_trip():
|
def test_round_trip():
|
||||||
freqs = {'the': 10, 'quick': 3, 'brown': 4, 'fox': 1, 'jumped': 5, 'over': 8,
|
freqs = {'the': 10, 'quick': 3, 'brown': 4, 'fox': 1, 'jumped': 5, 'over': 8,
|
||||||
'lazy': 1, 'dog': 2, '.': 9}
|
'lazy': 1, 'dog': 2, '.': 9}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user