From e27262f431809df9aa09c32145f1e7ee1eaa193a Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Tue, 23 May 2017 04:37:40 -0500 Subject: [PATCH] Go back to previous matcher signature, with on_match positional --- spacy/matcher.pyx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/spacy/matcher.pyx b/spacy/matcher.pyx index 20e2a8993..24bb7b65e 100644 --- a/spacy/matcher.pyx +++ b/spacy/matcher.pyx @@ -215,7 +215,7 @@ cdef class Matcher: """ return len(self._patterns) - def add(self, key, *patterns, **kwargs): + def add(self, key, on_match, *patterns): """Add a match-rule to the matcher. A match-rule consists of: an ID key, an on_match callback, and one or more patterns. If the key exists, the patterns are appended to the @@ -227,7 +227,6 @@ cdef class Matcher: descriptors can also include quantifiers. There are currently important known problems with the quantifiers – see the docs. """ - on_match = kwargs.get('on_match', None) for pattern in patterns: if len(pattern) == 0: msg = ("Cannot add pattern for zero tokens to matcher.\n"