mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 17:36:30 +03:00
commit
cc66a63e0a
4
setup.py
4
setup.py
|
@ -64,10 +64,6 @@ MOD_NAMES = [
|
|||
'spacy.symbols']
|
||||
|
||||
|
||||
if sys.version_info[:2] < (2, 7) or (3, 0) <= sys.version_info[0:2] < (3, 4):
|
||||
raise RuntimeError('Python version 2.7 or >= 3.4 required.')
|
||||
|
||||
|
||||
# By subclassing build_extensions we have the actual compiler that will be used
|
||||
# which is really known only after finalize_options
|
||||
# http://stackoverflow.com/questions/724664/python-distutils-how-to-get-a-compiler-that-is-going-to-be-used
|
||||
|
|
|
@ -58,7 +58,7 @@ def test_round_trip():
|
|||
message = ['the', 'quick', 'brown', 'fox', 'jumped', 'over', 'the',
|
||||
'the', 'lazy', 'dog', '.']
|
||||
strings = list(codec.strings)
|
||||
codes = {codec.leaves[i]: strings[i] for i in range(len(codec.leaves))}
|
||||
codes = dict([(codec.leaves[i], strings[i]) for i in range(len(codec.leaves))])
|
||||
bits = codec.encode(message)
|
||||
string = ''.join('{0:b}'.format(c).rjust(8, '0')[::-1] for c in bits.as_bytes())
|
||||
for word in message:
|
||||
|
@ -83,7 +83,7 @@ def test_rosetta():
|
|||
codec = HuffmanCodec(symb2freq.items())
|
||||
py_codec = py_encode(symb2freq)
|
||||
|
||||
codes = {codec.leaves[i]: codec.strings[i] for i in range(len(codec.leaves))}
|
||||
codes = dict([(codec.leaves[i], codec.strings[i]) for i in range(len(codec.leaves))])
|
||||
|
||||
my_lengths = defaultdict(int)
|
||||
py_lengths = defaultdict(int)
|
||||
|
|
Loading…
Reference in New Issue
Block a user