Skip to content

Commit b3af764

Browse files
committed
fix documentation of process.extractOne
1 parent 9b64ad2 commit b3af764

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.12.4
1+
0.12.5

docs/usage/process.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ Find the best matches in a list of choices.
4646
- **matches**: *List[Tuple[str, float]] or List[Tuple[str, float, str]])*
4747

4848
Returns a list of all matches that have a `score >= score_cutoff`. The list will
49-
be of either `(, )` when `choices` is a list of strings or `(, , )` when `choices` is a
50-
mapping.
49+
be of either `(<choice>, <ratio>)` when `choices` is a list of strings
50+
or `(<choice>, <ratio>, <key of choice>)` when `choices` is a mapping.
5151

5252

5353
```console
@@ -80,10 +80,9 @@ Finds the best match in a list of choices by comparing them using the provided s
8080

8181
Returns:
8282

83-
- **matches**: *Optional[Tuple[str, float]]*
83+
- **matches**: *Union[None, Tuple[str, float], Tuple[str, float, str]]*
8484

85-
Returns the best match in form of a tuple or None when there is
86-
no match with a `score >= score_cutoff`.
85+
Returns the best match the best match in form of a tuple or None when there is no match with a score >= score_cutoff. The Tuple will be in the form`(<choice>, <ratio>)` when `choices` is a list of strings or `(<choice>, <ratio>, <key of choice>)` when `choices` is a mapping.
8786

8887

8988
```console

src/rapidfuzz/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
"""
44
__author__ = "Max Bachmann"
55
__license__ = "MIT"
6-
__version__ = "0.12.4"
6+
__version__ = "0.12.5"
77

88
from rapidfuzz import process, fuzz, levenshtein, utils

src/rapidfuzz/process.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ def extract(query, choices, scorer = fuzz.WRatio, processor = utils.default_proc
7777
Returns:
7878
Union[List[Tuple[str, float]], List[Tuple[str, float, str]]]: Returns a
7979
list of all matches that have a `score >= score_cutoff`. The list will
80-
be of either `(, )` when `choices` is a list of strings or `(, , )` when
81-
`choices` is a mapping.
80+
be of either `(<choice>, <ratio>)` when `choices` is a list of strings
81+
or `(<choice>, <ratio>, <key of choice>)` when `choices` is a mapping.
8282
"""
8383
results = iterExtract(query, choices, scorer, processor, score_cutoff)
8484

@@ -137,6 +137,10 @@ def extractOne(query, choices, scorer = fuzz.WRatio, processor = utils.default_p
137137
Returns:
138138
Optional[Tuple[str, float]]: returns the best match in form of a tuple or None when there is
139139
no match with a score >= score_cutoff
140+
Union[None, Tuple[str, float], Tuple[str, float, str]]: Returns the best match the best match
141+
in form of a tuple or None when there is no match with a score >= score_cutoff. The Tuple will
142+
be in the form`(<choice>, <ratio>)` when `choices` is a list of strings
143+
or `(<choice>, <ratio>, <key of choice>)` when `choices` is a mapping.
140144
"""
141145
if query is None:
142146
return None

0 commit comments

Comments
 (0)