Filter out morphology keys in deprecated attrs

This commit is contained in:
Matthew Honnibal 2016-12-18 16:50:26 +01:00
parent 837a5d4100
commit d58187ffa7
1 changed files with 8 additions and 2 deletions

View File

@ -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