rust-scorer 0.3.4__cp311-cp311-macosx_10_12_x86_64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
rust_scorer/__init__.py
ADDED
rust_scorer/__init__.pyi
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"""Type stubs for rust_scorer - high-performance fuzzy matching for BibItems."""
|
|
2
|
+
|
|
3
|
+
from typing import TypedDict
|
|
4
|
+
|
|
5
|
+
class BibItemData(TypedDict):
|
|
6
|
+
"""Input data for a single BibItem."""
|
|
7
|
+
|
|
8
|
+
index: int
|
|
9
|
+
title: str
|
|
10
|
+
author: str
|
|
11
|
+
year: int | None
|
|
12
|
+
doi: str | None
|
|
13
|
+
journal: str | None
|
|
14
|
+
volume: str | None
|
|
15
|
+
number: str | None
|
|
16
|
+
pages: str | None
|
|
17
|
+
publisher: str | None
|
|
18
|
+
|
|
19
|
+
class MatchResult(TypedDict):
|
|
20
|
+
"""Result of scoring a candidate against a subject."""
|
|
21
|
+
|
|
22
|
+
candidate_index: int
|
|
23
|
+
total_score: float
|
|
24
|
+
title_score: float
|
|
25
|
+
author_score: float
|
|
26
|
+
date_score: float
|
|
27
|
+
bonus_score: float
|
|
28
|
+
|
|
29
|
+
class SubjectMatchResult(TypedDict):
|
|
30
|
+
"""Result for a single subject with its top matches."""
|
|
31
|
+
|
|
32
|
+
subject_index: int
|
|
33
|
+
matches: list[MatchResult]
|
|
34
|
+
candidates_searched: int
|
|
35
|
+
|
|
36
|
+
def token_sort_ratio(s1: str, s2: str) -> float:
|
|
37
|
+
"""Token sort ratio using Jaro-Winkler similarity.
|
|
38
|
+
|
|
39
|
+
Args:
|
|
40
|
+
s1: First string to compare
|
|
41
|
+
s2: Second string to compare
|
|
42
|
+
|
|
43
|
+
Returns:
|
|
44
|
+
Similarity score from 0.0 to 100.0
|
|
45
|
+
"""
|
|
46
|
+
...
|
|
47
|
+
|
|
48
|
+
def score_batch(
|
|
49
|
+
subjects: list[BibItemData],
|
|
50
|
+
candidates: list[BibItemData],
|
|
51
|
+
top_n: int,
|
|
52
|
+
min_score: float,
|
|
53
|
+
) -> list[SubjectMatchResult]:
|
|
54
|
+
"""Batch score multiple subjects against candidates in parallel.
|
|
55
|
+
|
|
56
|
+
Args:
|
|
57
|
+
subjects: List of BibItems to find matches for
|
|
58
|
+
candidates: List of BibItems to match against
|
|
59
|
+
top_n: Maximum number of matches to return per subject
|
|
60
|
+
min_score: Minimum score threshold for matches
|
|
61
|
+
|
|
62
|
+
Returns:
|
|
63
|
+
List of results, one per subject, containing top matches
|
|
64
|
+
"""
|
|
65
|
+
...
|
rust_scorer/py.typed
ADDED
|
File without changes
|
|
Binary file
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: rust_scorer
|
|
3
|
+
Version: 0.3.4
|
|
4
|
+
Classifier: Programming Language :: Rust
|
|
5
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
6
|
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
7
|
+
Requires-Python: >=3.8
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
rust_scorer/__init__.py,sha256=NEi2bG_00jHJH8W6ZQAQuktPcHv9Sha7bZ4pAY3pqJ0,127
|
|
2
|
+
rust_scorer/__init__.pyi,sha256=CDT-4bpH9pOlEkxaqbVOzrZTiTIFzy5dsn8rqRT23Rs,1623
|
|
3
|
+
rust_scorer/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
+
rust_scorer/rust_scorer.cpython-311-darwin.so,sha256=Blt9OTyV1OLn7P5L8U7FKx41f6DiLZxGUtbZjsV0S9I,668920
|
|
5
|
+
rust_scorer-0.3.4.dist-info/METADATA,sha256=T_WwlgNf5XUBr-OiyphxLGgGfLQf_BssNxQed2gekMg,260
|
|
6
|
+
rust_scorer-0.3.4.dist-info/WHEEL,sha256=uo497LsoCAD-gruBuBwmuPSjitTK7HU_NyyROWcAuhA,107
|
|
7
|
+
rust_scorer-0.3.4.dist-info/RECORD,,
|