mirror of https://github.com/explosion/spaCy.git
Fix intify_attrs function for obsolete data
This commit is contained in:
parent
987ee6e884
commit
dd9ea478c5
|
@ -143,8 +143,12 @@ def intify_attrs(stringy_attrs, strings_map=None, _do_deprecated=False):
|
||||||
for name, value in stringy_attrs.items():
|
for name, value in stringy_attrs.items():
|
||||||
if isinstance(name, int):
|
if isinstance(name, int):
|
||||||
int_key = name
|
int_key = name
|
||||||
else:
|
elif name in IDS:
|
||||||
|
int_key = IDS[name]
|
||||||
|
elif name.upper() in IDS:
|
||||||
int_key = IDS[name.upper()]
|
int_key = IDS[name.upper()]
|
||||||
|
else:
|
||||||
|
continue
|
||||||
if strings_map is not None and isinstance(value, basestring):
|
if strings_map is not None and isinstance(value, basestring):
|
||||||
if hasattr(strings_map, 'add'):
|
if hasattr(strings_map, 'add'):
|
||||||
value = strings_map.add(value)
|
value = strings_map.add(value)
|
||||||
|
|
Loading…
Reference in New Issue