forked from rapidfuzz/RapidFuzz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstring_metric_py.pyi
78 lines (74 loc) · 1.74 KB
/
string_metric_py.pyi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
from typing import (
Callable,
Hashable,
Sequence,
Optional,
TypeVar,
Tuple,
List,
Any,
Dict,
)
from typing_extensions import Protocol
class _ScorerAttributes(Protocol):
_RF_ScorerPy: Dict
def _attr_decorator(func: Any) -> _ScorerAttributes:
return func
_StringType = Sequence[Hashable]
_S1 = TypeVar("_S1")
_S2 = TypeVar("_S2")
@_attr_decorator
def levenshtein(
s1: _S1,
s2: _S2,
*,
weights: Optional[Tuple[int, int, int]] = (1, 1, 1),
processor: Optional[Callable[..., _StringType]] = None,
max: Optional[int] = None
) -> int: ...
@_attr_decorator
def normalized_levenshtein(
s1: _S1,
s2: _S2,
*,
weights: Optional[Tuple[int, int, int]] = (1, 1, 1),
processor: Optional[Callable[..., _StringType]] = None,
score_cutoff: Optional[float] = 0
) -> float: ...
@_attr_decorator
def levenshtein_editops(
s1: _S1, s2: _S2, *, processor: Optional[Callable[..., _StringType]] = None
) -> List[Tuple[str, int, int]]: ...
@_attr_decorator
def hamming(
s1: _S1,
s2: _S2,
*,
processor: Optional[Callable[..., _StringType]] = None,
max: Optional[int] = None
) -> int: ...
@_attr_decorator
def normalized_hamming(
s1: _S1,
s2: _S2,
*,
processor: Optional[Callable[..., _StringType]] = None,
score_cutoff: Optional[float] = 0
) -> float: ...
@_attr_decorator
def jaro_similarity(
s1: _S1,
s2: _S2,
*,
processor: Optional[Callable[..., _StringType]] = None,
score_cutoff: Optional[float] = 0
) -> float: ...
@_attr_decorator
def jaro_winkler_similarity(
s1: _S1,
s2: _S2,
*,
prefix_weight: float = 0.1,
processor: Optional[Callable[..., _StringType]] = None,
score_cutoff: Optional[float] = 0
) -> float: ...