From c38c33058585a9de3be001d499b210b56f4d1a85 Mon Sep 17 00:00:00 2001 From: Adriane Boyd Date: Sat, 21 Sep 2019 15:57:38 +0200 Subject: [PATCH] Add missing loop for match ID set in search loop --- spacy/matcher/phrasematcher.pyx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spacy/matcher/phrasematcher.pyx b/spacy/matcher/phrasematcher.pyx index ef55b0e68..375b25b46 100644 --- a/spacy/matcher/phrasematcher.pyx +++ b/spacy/matcher/phrasematcher.pyx @@ -192,8 +192,9 @@ cdef class PhraseMatcher: # if end is present in current_dict if self._terminal in current_dict or token in current_dict: if self._terminal in current_dict: - ent_id = current_dict[self._terminal] - matches.append((self.vocab.strings[ent_id], start, idx)) + ent_ids = current_dict[self._terminal] + for ent_id in ent_ids: + matches.append((self.vocab.strings[ent_id], start, idx)) # look for longer sequences from this position if token in current_dict: