From 9f658799911986adc150ae53a1bdcbee7e2137f9 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Thu, 6 Aug 2015 17:28:14 +0200 Subject: [PATCH] * Fix shape attr bug, and fix handling of false positive matches --- spacy/matcher.pyx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spacy/matcher.pyx b/spacy/matcher.pyx index 7d5d4062a..ee2ceaecc 100644 --- a/spacy/matcher.pyx +++ b/spacy/matcher.pyx @@ -86,7 +86,7 @@ def map_attr_name(attr): return LEMMA elif attr == 'LOWER': return LOWER - elif attr == 'SHAOE': + elif attr == 'SHAPE': return SHAPE elif attr == 'NORM': return NORM @@ -109,6 +109,8 @@ cdef class Matcher: entity_key = vocab.strings[entity_key] if isinstance(etype, basestring): etype = vocab.strings[etype] + elif etype is None: + etype = -1 # TODO: Do something more clever about multiple patterns for single # entity for spec in specs: