From d58187ffa797614b657c21ab9e7c55aab2a4f7ab Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Sun, 18 Dec 2016 16:50:26 +0100 Subject: [PATCH] Filter out morphology keys in deprecated attrs --- spacy/attrs.pyx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/spacy/attrs.pyx b/spacy/attrs.pyx index ce4005324..ddcbdff64 100644 --- a/spacy/attrs.pyx +++ b/spacy/attrs.pyx @@ -120,8 +120,14 @@ def intify_attrs(stringy_attrs, strings_map=None, _do_deprecated=False): stringy_attrs.pop('number') if 'tenspect' in stringy_attrs: stringy_attrs.pop('tenspect') - # for name, value in morphs.items(): - # stringy_attrs[name] = value + morph_keys = [ + 'PunctType', 'PunctSide', 'Other', 'Degree', 'AdvType', 'Number', + 'VerbForm', 'PronType', 'Aspect', 'Tense', 'PartType', 'Poss', + 'Hyph', 'ConjType', 'NumType', 'Foreign', 'VerbType', 'NounType', + 'Number', 'PronType', 'AdjType', 'Person'] + for key in morph_keys: + if key in stringy_attrs: + stringy_attrs.pop(key) for name, value in stringy_attrs.items(): if isinstance(name, int): int_key = name