Fix morphology for | features

This commit is contained in:
Matthew Honnibal 2019-08-25 21:57:02 +02:00
parent 095c63c6b8
commit 188a1cf297
1 changed files with 4 additions and 0 deletions

View File

@ -71,6 +71,10 @@ def _normalize_props(props):
for key in FIELDS: for key in FIELDS:
if key in props: if key in props:
value = str(props[key]).lower() value = str(props[key]).lower()
# We don't have support for disjunctive int|rel features, so
# just take the first one :(
if "|" in value:
value = value.split("|")[0]
attr = '%s_%s' % (key, value) attr = '%s_%s' % (key, value)
if attr in FEATURES: if attr in FEATURES:
props.pop(key) props.pop(key)