From 893f11a9e38d4a29c608602e61798a29d4800d99 Mon Sep 17 00:00:00 2001 From: Adriane Boyd Date: Fri, 30 Aug 2019 11:30:03 +0200 Subject: [PATCH] Serialize tag_map directly Fix Aspect_prof typo --- spacy/morphology.pyx | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/spacy/morphology.pyx b/spacy/morphology.pyx index a7a1bee57..f706fec7f 100644 --- a/spacy/morphology.pyx +++ b/spacy/morphology.pyx @@ -327,16 +327,11 @@ cdef class Morphology: self.add_special_case(tag_str, form_str, attrs) def to_bytes(self, exclude=tuple(), **kwargs): - tag_map = {} - for key in self.tags: - tag_ptr = self.tags.get(key) - if tag_ptr != NULL: - tag_map[key] = tag_to_json(tag_ptr) exceptions = {} for (tag_str, orth_int), attrs in sorted(self.exc.items()): exceptions.setdefault(tag_str, {}) exceptions[tag_str][self.strings[orth_int]] = attrs - data = {"tag_map": tag_map, "exceptions": exceptions} + data = {"tag_map": self.tag_map, "exceptions": exceptions} return srsly.msgpack_dumps(data) def from_bytes(self, byte_string): @@ -898,7 +893,7 @@ FEATURES = [ "Aspect_mod", "Aspect_none", "Aspect_perf", - "Aspect_prof", + "Aspect_prog", "Aspect_prosp", "Case_abe", "Case_abl",