diff --git a/extern/rapidfuzz-cpp b/extern/rapidfuzz-cpp index 10426d24..cb4b1c78 160000 --- a/extern/rapidfuzz-cpp +++ b/extern/rapidfuzz-cpp @@ -1 +1 @@ -Subproject commit 10426d24cd7479df0fe8c78b17877e756e1c3cd5 +Subproject commit cb4b1c78d65f74e40c0960afb964eabb67604c85 diff --git a/src/rapidfuzz/distance/metrics_cpp.pyi b/src/rapidfuzz/distance/metrics_cpp.pyi deleted file mode 100644 index 36bc8533..00000000 --- a/src/rapidfuzz/distance/metrics_cpp.pyi +++ /dev/null @@ -1,262 +0,0 @@ -from __future__ import annotations - -from typing import Callable, Hashable, Sequence, TypeVar - -from rapidfuzz.distance import Editops, Opcodes - -_StringType = Sequence[Hashable] -_S1 = TypeVar("_S1") -_S2 = TypeVar("_S2") - -def levenshtein_distance( - s1: _S1, - s2: _S2, - *, - weights: tuple[int, int, int] | None = (1, 1, 1), - processor: Callable[..., _StringType] | None = None, - score_cutoff: int | None = None, -) -> int: ... -def levenshtein_normalized_distance( - s1: _S1, - s2: _S2, - *, - weights: tuple[int, int, int] | None = (1, 1, 1), - processor: Callable[..., _StringType] | None = None, - score_cutoff: float | None = 0, -) -> float: ... -def levenshtein_similarity( - s1: _S1, - s2: _S2, - *, - weights: tuple[int, int, int] | None = (1, 1, 1), - processor: Callable[..., _StringType] | None = None, - score_cutoff: int | None = None, -) -> int: ... -def levenshtein_normalized_similarity( - s1: _S1, - s2: _S2, - *, - weights: tuple[int, int, int] | None = (1, 1, 1), - processor: Callable[..., _StringType] | None = None, - score_cutoff: float | None = 0, -) -> float: ... -def levenshtein_editops( - s1: _S1, - s2: _S2, - *, - processor: Callable[..., _StringType] | None = None, - score_hint: int | None = None, -) -> Editops: ... -def levenshtein_opcodes( - s1: _S1, - s2: _S2, - *, - processor: Callable[..., _StringType] | None = None, - score_hint: int | None = None, -) -> Opcodes: ... -def indel_distance( - s1: _S1, - s2: _S2, - *, - processor: Callable[..., _StringType] | None = None, - score_cutoff: int | None = None, -) -> int: ... -def indel_normalized_distance( - s1: _S1, - s2: _S2, - *, - processor: Callable[..., _StringType] | None = None, - score_cutoff: float | None = 0, -) -> float: ... -def indel_similarity( - s1: _S1, - s2: _S2, - *, - processor: Callable[..., _StringType] | None = None, - score_cutoff: int | None = None, -) -> int: ... -def indel_normalized_similarity( - s1: _S1, - s2: _S2, - *, - processor: Callable[..., _StringType] | None = None, - score_cutoff: float | None = 0, -) -> float: ... -def indel_editops(s1: _S1, s2: _S2, *, processor: Callable[..., _StringType] | None = None) -> Editops: ... -def indel_opcodes(s1: _S1, s2: _S2, *, processor: Callable[..., _StringType] | None = None) -> Opcodes: ... -def lcs_seq_distance( - s1: _S1, - s2: _S2, - *, - processor: Callable[..., _StringType] | None = None, - score_cutoff: int | None = None, -) -> int: ... -def lcs_seq_normalized_distance( - s1: _S1, - s2: _S2, - *, - processor: Callable[..., _StringType] | None = None, - score_cutoff: float | None = 0, -) -> float: ... -def lcs_seq_similarity( - s1: _S1, - s2: _S2, - *, - processor: Callable[..., _StringType] | None = None, - score_cutoff: int | None = None, -) -> int: ... -def lcs_seq_normalized_similarity( - s1: _S1, - s2: _S2, - *, - processor: Callable[..., _StringType] | None = None, - score_cutoff: float | None = 0, -) -> float: ... -def lcs_seq_editops(s1: _S1, s2: _S2, *, processor: Callable[..., _StringType] | None = None) -> Editops: ... -def lcs_seq_opcodes(s1: _S1, s2: _S2, *, processor: Callable[..., _StringType] | None = None) -> Opcodes: ... -def hamming_distance( - s1: _S1, - s2: _S2, - *, - processor: Callable[..., _StringType] | None = None, - score_cutoff: int | None = None, -) -> int: ... -def hamming_normalized_distance( - s1: _S1, - s2: _S2, - *, - processor: Callable[..., _StringType] | None = None, - score_cutoff: float | None = 0, -) -> float: ... -def hamming_similarity( - s1: _S1, - s2: _S2, - *, - processor: Callable[..., _StringType] | None = None, - score_cutoff: int | None = None, -) -> int: ... -def hamming_normalized_similarity( - s1: _S1, - s2: _S2, - *, - processor: Callable[..., _StringType] | None = None, - score_cutoff: float | None = 0, -) -> float: ... -def hamming_editops(s1: _S1, s2: _S2, *, processor: Callable[..., _StringType] | None = None) -> Editops: ... -def hamming_opcodes(s1: _S1, s2: _S2, *, processor: Callable[..., _StringType] | None = None) -> Opcodes: ... -def damerau_levenshtein_distance( - s1: _S1, - s2: _S2, - *, - processor: Callable[..., _StringType] | None = None, - score_cutoff: int | None = None, -) -> int: ... -def damerau_levenshtein_normalized_distance( - s1: _S1, - s2: _S2, - *, - processor: Callable[..., _StringType] | None = None, - score_cutoff: float | None = 0, -) -> float: ... -def damerau_levenshtein_similarity( - s1: _S1, - s2: _S2, - *, - processor: Callable[..., _StringType] | None = None, - score_cutoff: int | None = None, -) -> int: ... -def damerau_levenshtein_normalized_similarity( - s1: _S1, - s2: _S2, - *, - processor: Callable[..., _StringType] | None = None, - score_cutoff: float | None = 0, -) -> float: ... -def osa_distance( - s1: _S1, - s2: _S2, - *, - processor: Callable[..., _StringType] | None = None, - score_cutoff: int | None = None, -) -> int: ... -def osa_normalized_distance( - s1: _S1, - s2: _S2, - *, - processor: Callable[..., _StringType] | None = None, - score_cutoff: float | None = 0, -) -> float: ... -def osa_similarity( - s1: _S1, - s2: _S2, - *, - processor: Callable[..., _StringType] | None = None, - score_cutoff: int | None = None, -) -> int: ... -def osa_normalized_similarity( - s1: _S1, - s2: _S2, - *, - processor: Callable[..., _StringType] | None = None, - score_cutoff: float | None = 0, -) -> float: ... -def jaro_distance( - s1: _S1, - s2: _S2, - *, - processor: Callable[..., _StringType] | None = None, - score_cutoff: int | None = None, -) -> float: ... -def jaro_normalized_distance( - s1: _S1, - s2: _S2, - *, - processor: Callable[..., _StringType] | None = None, - score_cutoff: float | None = 0, -) -> float: ... -def jaro_similarity( - s1: _S1, - s2: _S2, - *, - processor: Callable[..., _StringType] | None = None, - score_cutoff: int | None = None, -) -> float: ... -def jaro_normalized_similarity( - s1: _S1, - s2: _S2, - *, - processor: Callable[..., _StringType] | None = None, - score_cutoff: float | None = 0, -) -> float: ... -def jaro_winkler_distance( - s1: _S1, - s2: _S2, - *, - prefix_weight: float = 0.1, - processor: Callable[..., _StringType] | None = None, - score_cutoff: int | None = None, -) -> float: ... -def jaro_winkler_normalized_distance( - s1: _S1, - s2: _S2, - *, - prefix_weight: float = 0.1, - processor: Callable[..., _StringType] | None = None, - score_cutoff: float | None = 0, -) -> float: ... -def jaro_winkler_similarity( - s1: _S1, - s2: _S2, - *, - prefix_weight: float = 0.1, - processor: Callable[..., _StringType] | None = None, - score_cutoff: int | None = None, -) -> float: ... -def jaro_winkler_normalized_similarity( - s1: _S1, - s2: _S2, - *, - prefix_weight: float = 0.1, - processor: Callable[..., _StringType] | None = None, - score_cutoff: float | None = 0, -) -> float: ... diff --git a/src/rapidfuzz/process_cpp_impl.pyi b/src/rapidfuzz/process_cpp_impl.pyi deleted file mode 100644 index 8a1e20da..00000000 --- a/src/rapidfuzz/process_cpp_impl.pyi +++ /dev/null @@ -1,129 +0,0 @@ -from __future__ import annotations - -from typing import ( - Any, - Callable, - Collection, - Generator, - Hashable, - Iterable, - Mapping, - Sequence, - TypeVar, - overload, -) - -from rapidfuzz.fuzz import WRatio, ratio - -_StringType = Sequence[Hashable] -_StringType1 = TypeVar("_StringType1", bound=Sequence[Hashable]) -_StringType2 = TypeVar("_StringType2", bound=Sequence[Hashable]) -_KeyType = TypeVar("_KeyType") -_ResultType = TypeVar("_ResultType", int, float) - -@overload -def extractOne( - query: _StringType1 | None, - choices: Mapping[_KeyType, _StringType2 | None], - *, - scorer: Callable[..., _ResultType] = WRatio, - processor: Callable[..., _StringType] | None = None, - score_cutoff: _ResultType | None = None, - score_hint: _ResultType | None = None, - scorer_kwargs: dict[str, Any] | None = None, -) -> tuple[_StringType2, _ResultType, _KeyType]: ... -@overload -def extractOne( - query: _StringType1 | None, - choices: Iterable[_StringType2 | None], - *, - scorer: Callable[..., _ResultType] = WRatio, - processor: Callable[..., _StringType] | None = None, - score_cutoff: _ResultType | None = None, - score_hint: _ResultType | None = None, - scorer_kwargs: dict[str, Any] | None = None, -) -> tuple[_StringType2, _ResultType, int]: ... -@overload -def extract( - query: _StringType1 | None, - choices: Mapping[_KeyType, _StringType2 | None], - *, - scorer: Callable[..., _ResultType] = WRatio, - processor: Callable[..., _StringType] | None = None, - limit: int | None = 5, - score_cutoff: _ResultType | None = None, - score_hint: _ResultType | None = None, - scorer_kwargs: dict[str, Any] | None = None, -) -> list[tuple[_StringType2, _ResultType, _KeyType]]: ... -@overload -def extract( - query: _StringType1 | None, - choices: Collection[_StringType2 | None], - *, - scorer: Callable[..., _ResultType] = WRatio, - processor: Callable[..., _StringType] | None = None, - limit: int | None = 5, - score_cutoff: _ResultType | None = None, - score_hint: _ResultType | None = None, - scorer_kwargs: dict[str, Any] | None = None, -) -> list[tuple[_StringType2, _ResultType, int]]: ... -@overload -def extract_iter( - query: _StringType1 | None, - choices: Iterable[_StringType2 | None], - *, - scorer: Callable[..., _ResultType] = WRatio, - processor: Callable[..., _StringType] | None = None, - score_cutoff: _ResultType | None = None, - score_hint: _ResultType | None = None, - scorer_kwargs: dict[str, Any] | None = None, -) -> Generator[tuple[_StringType2, _ResultType, int], None, None]: ... -@overload -def extract_iter( - query: _StringType1 | None, - choices: Mapping[_KeyType, _StringType2 | None], - *, - scorer: Callable[..., _ResultType] = WRatio, - processor: Callable[..., _StringType] | None = None, - score_cutoff: _ResultType | None = None, - score_hint: _ResultType | None = None, - scorer_kwargs: dict[str, Any] | None = None, -) -> Generator[tuple[_StringType2, _ResultType, _KeyType], None, None]: ... - -FLOAT32: int -FLOAT64: int -INT8: int -INT16: int -INT32: int -INT64: int -UINT8: int -UINT16: int -UINT32: int -UINT64: int - -def cdist( - queries: Iterable[_StringType1], - choices: Iterable[_StringType2], - *, - scorer: Callable[..., _ResultType] = ratio, - processor: Callable[..., _StringType] | None = None, - score_cutoff: _ResultType | None = None, - score_hint: _ResultType | None = None, - score_multiplier: _ResultType | None = None, - dtype: int | None = None, - workers: int = 1, - scorer_kwargs: dict[str, Any] | None = None, -) -> Any: ... -def cpdist( - queries: Iterable[_StringType1], - choices: Iterable[_StringType2], - *, - scorer: Callable[..., _ResultType] = ratio, - processor: Callable[..., _StringType] | None = None, - score_cutoff: _ResultType | None = None, - score_hint: _ResultType | None = None, - score_multiplier: _ResultType | None = None, - dtype: int | None = None, - workers: int = 1, - scorer_kwargs: dict[str, Any] | None = None, -) -> Any: ...