mirror of
https://github.com/explosion/spaCy.git
synced 2025-08-05 04:40:20 +03:00
Update fuzzy_compare default argument declarations
This commit is contained in:
parent
c3f446f71b
commit
bde46b7db1
|
@ -78,5 +78,3 @@ cdef class Matcher:
|
||||||
cdef public object _extra_predicates
|
cdef public object _extra_predicates
|
||||||
cdef public object _seen_attrs
|
cdef public object _seen_attrs
|
||||||
cdef public object _fuzzy_compare
|
cdef public object _fuzzy_compare
|
||||||
|
|
||||||
cpdef bint _default_fuzzy_compare(s1: str, s2: str, fuzzy: int)
|
|
||||||
|
|
|
@ -53,4 +53,4 @@ class Matcher:
|
||||||
) -> List[Span]: ...
|
) -> List[Span]: ...
|
||||||
def _normalize_key(self, key: Any) -> Any: ...
|
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: ...
|
||||||
|
|
|
@ -1150,7 +1150,7 @@ def _get_extensions(spec, string_store, name2index):
|
||||||
return attr_values
|
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 = min(len(s1), len(s2))
|
||||||
distance -= 1 # don't allow completely different tokens
|
distance -= 1 # don't allow completely different tokens
|
||||||
if fuzzy == -1: # FUZZY operator with unspecified fuzzy
|
if fuzzy == -1: # FUZZY operator with unspecified fuzzy
|
||||||
|
|
Loading…
Reference in New Issue
Block a user