Fix None label in matcher

This commit is contained in:
Matthew Honnibal 2016-10-18 18:05:21 +02:00
parent c3a8a1cf51
commit 05e2a589a4
1 changed files with 3 additions and 1 deletions

View File

@ -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))