From 05e2a589a4f509eb4792eb8b832d94357a602775 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Tue, 18 Oct 2016 18:05:21 +0200 Subject: [PATCH] Fix None label in matcher --- spacy/matcher.pyx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spacy/matcher.pyx b/spacy/matcher.pyx index b6c2def8e..c3e40c1a0 100644 --- a/spacy/matcher.pyx +++ b/spacy/matcher.pyx @@ -228,8 +228,10 @@ cdef class Matcher: self.add_entity(entity_key) if isinstance(label, basestring): label = self.vocab.strings[label] - + elif label is None: + label = 0 spec = _convert_strings(token_specs, self.vocab.strings) + self.patterns.push_back(init_pattern(self.mem, entity_key, label, spec)) self._patterns[entity_key].append((label, token_specs))