From cf6f208409c8add6b645e23aaafb72303c71fa14 Mon Sep 17 00:00:00 2001 From: Ankush-Chander Date: Wed, 21 Dec 2022 18:51:58 +0530 Subject: [PATCH] fix match id --- spacy/matcher/matcher.pyx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spacy/matcher/matcher.pyx b/spacy/matcher/matcher.pyx index 56ac62a97..72a7525e2 100644 --- a/spacy/matcher/matcher.pyx +++ b/spacy/matcher/matcher.pyx @@ -318,10 +318,10 @@ cdef class Matcher: for (key, *_) in final_matches: key_matches[key].append((key,*_)) - for key, matches in key_matches.items(): + for i, (key, matches) in enumerate(key_matches.items()): on_match = self._callbacks.get(key, None) if on_match is not None: - on_match(self, doc, key, matches) + on_match(self, doc, i, matches) return final_results def _normalize_key(self, key):