From bd3c3f342b01cd0b48e1a02bc11bc37c9d9e63a9 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Thu, 11 Jul 2019 11:48:55 +0200 Subject: [PATCH 1/2] Fix _serialize --- spacy/tokens/_serialize.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spacy/tokens/_serialize.py b/spacy/tokens/_serialize.py index c4478e080..57bc98f4b 100644 --- a/spacy/tokens/_serialize.py +++ b/spacy/tokens/_serialize.py @@ -124,10 +124,10 @@ def pickle_box(box): def unpickle_box(byte_string): - return Box().from_bytes(byte_string) + return DocBox().from_bytes(byte_string) -copy_reg.pickle(Box, pickle_box, unpickle_box) +copy_reg.pickle(DocBox, pickle_box, unpickle_box) # Compatibility, as we had named it this previously. Binder = DocBox From 0491a8e7c83dcbf8a293305681b498d38514541f Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Thu, 11 Jul 2019 11:49:36 +0200 Subject: [PATCH 2/2] Reformat --- spacy/tokens/_serialize.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacy/tokens/_serialize.py b/spacy/tokens/_serialize.py index 57bc98f4b..41f524839 100644 --- a/spacy/tokens/_serialize.py +++ b/spacy/tokens/_serialize.py @@ -116,7 +116,7 @@ def merge_boxes(boxes): if merged is not None: return merged.to_bytes() else: - return b'' + return b"" def pickle_box(box):