mirror of
https://github.com/SickGear/SickGear.git
synced 2024-11-27 15:13:38 +00:00
2a73990c82
Removes Levenshtein requirement with direct use of rapidfuzz instead Fallback to old fuzzywuzzy for pure python implementation
17 lines
705 B
Python
17 lines
705 B
Python
from collections.abc import Mapping
|
|
import typing
|
|
from typing import Any, Callable, Union, Tuple, Generator, TypeVar, Sequence
|
|
|
|
|
|
ChoicesT = Union[Mapping[str, str], Sequence[str]]
|
|
T = TypeVar('T')
|
|
ProcessorT = Union[Callable[[str, bool], str], Callable[[Any], Any]]
|
|
ScorerT = Callable[[str, str, bool, bool], int]
|
|
|
|
|
|
@typing.overload
|
|
def extractWithoutOrder(query: str, choices: Mapping[str, str], processor: ProcessorT, scorer: ScorerT, score_cutoff: int = ...) -> Generator[Tuple[str, int, str], None, None]: ...
|
|
|
|
|
|
@typing.overload
|
|
def extractWithoutOrder(query: str, choices: Sequence[str], processor: ProcessorT, scorer: ScorerT, score_cutoff: int = ...) -> Generator[Tuple[str, int], None, None]: ...
|