diff --git a/spacy/matcher/matcher.pxd b/spacy/matcher/matcher.pxd index 98df3ea92..51854d562 100644 --- a/spacy/matcher/matcher.pxd +++ b/spacy/matcher/matcher.pxd @@ -78,5 +78,3 @@ cdef class Matcher: cdef public object _extra_predicates cdef public object _seen_attrs cdef public object _fuzzy_compare - -cpdef bint _default_fuzzy_compare(s1: str, s2: str, fuzzy: int) diff --git a/spacy/matcher/matcher.pyi b/spacy/matcher/matcher.pyi index 8443ddd14..5371523cb 100644 --- a/spacy/matcher/matcher.pyi +++ b/spacy/matcher/matcher.pyi @@ -53,4 +53,4 @@ class Matcher: ) -> List[Span]: ... def _normalize_key(self, key: Any) -> Any: ... -def _default_fuzzy_compare(s1: str, s2: str, fuzzy: int) -> bool: ... +def _default_fuzzy_compare(s1: str, s2: str, fuzzy: int = -1) -> bool: ... diff --git a/spacy/matcher/matcher.pyx b/spacy/matcher/matcher.pyx index 570c3bc1a..963c156d9 100644 --- a/spacy/matcher/matcher.pyx +++ b/spacy/matcher/matcher.pyx @@ -1150,7 +1150,7 @@ def _get_extensions(spec, string_store, name2index): return attr_values -cpdef bint _default_fuzzy_compare(s1: str, s2: str, fuzzy: int): +cpdef bint _default_fuzzy_compare(s1: str, s2: str, fuzzy: int = -1): distance = min(len(s1), len(s2)) distance -= 1 # don't allow completely different tokens if fuzzy == -1: # FUZZY operator with unspecified fuzzy