* Fix shape attr bug, and fix handling of false positive matches

This commit is contained in:
Matthew Honnibal 2015-08-06 17:28:14 +02:00
parent 855af087fc
commit 9f65879991

View File

@ -86,7 +86,7 @@ def map_attr_name(attr):
return LEMMA return LEMMA
elif attr == 'LOWER': elif attr == 'LOWER':
return LOWER return LOWER
elif attr == 'SHAOE': elif attr == 'SHAPE':
return SHAPE return SHAPE
elif attr == 'NORM': elif attr == 'NORM':
return NORM return NORM
@ -109,6 +109,8 @@ cdef class Matcher:
entity_key = vocab.strings[entity_key] entity_key = vocab.strings[entity_key]
if isinstance(etype, basestring): if isinstance(etype, basestring):
etype = vocab.strings[etype] etype = vocab.strings[etype]
elif etype is None:
etype = -1
# TODO: Do something more clever about multiple patterns for single # TODO: Do something more clever about multiple patterns for single
# entity # entity
for spec in specs: for spec in specs: