ocr-stringdist 1.0.0__cp313-cp313-musllinux_1_1_i686.whl → 1.0.1__cp313-cp313-musllinux_1_1_i686.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.
@@ -1,10 +1,12 @@
1
1
  from .default_ocr_distances import ocr_distance_map
2
+ from .edit_operation import EditOperation
2
3
  from .learner import CostLearner
3
4
  from .levenshtein import WeightedLevenshtein
4
5
  from .matching import find_best_candidate
5
6
 
6
7
  __all__ = [
7
8
  "ocr_distance_map",
9
+ "EditOperation",
8
10
  "CostLearner",
9
11
  "WeightedLevenshtein",
10
12
  "find_best_candidate",
@@ -1,5 +1,5 @@
1
- from dataclasses import dataclass
2
- from typing import Literal, Optional
1
+ from dataclasses import asdict, dataclass
2
+ from typing import Any, Literal, Optional
3
3
 
4
4
  OperationType = Literal["substitute", "insert", "delete", "match"]
5
5
 
@@ -14,3 +14,6 @@ class EditOperation:
14
14
  source_token: Optional[str]
15
15
  target_token: Optional[str]
16
16
  cost: float
17
+
18
+ def to_dict(self) -> dict[str, Any]:
19
+ return asdict(self)
@@ -191,6 +191,7 @@ class WeightedLevenshtein:
191
191
  For the counterpart, see :meth:`WeightedLevenshtein.to_dict`.
192
192
 
193
193
  :param data: A dictionary with (not necessarily all of) the following keys:
194
+
194
195
  - "substitution_costs": {"from": str, "to": str, "cost": float}
195
196
  - "substitution_costs": dict[str, float]
196
197
  - "deletion_costs": dict[str, float]
@@ -206,7 +207,7 @@ class WeightedLevenshtein:
206
207
 
207
208
  return cls(
208
209
  substitution_costs=sub_costs,
209
- insertion_costs=data.get("substitution_costs"),
210
+ insertion_costs=data.get("insertion_costs"),
210
211
  deletion_costs=data.get("deletion_costs"),
211
212
  symmetric_substitution=data.get("symmetric_substitution", True),
212
213
  default_substitution_cost=data.get("default_substitution_cost", 1.0),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ocr-stringdist
3
- Version: 1.0.0
3
+ Version: 1.0.1
4
4
  Classifier: Programming Language :: Rust
5
5
  Classifier: Programming Language :: Python :: Implementation :: CPython
6
6
  Classifier: License :: OSI Approved :: MIT License
@@ -1,14 +1,14 @@
1
- ocr_stringdist-1.0.0.dist-info/METADATA,sha256=sFZnhhX8kHoYFbMua4zHCq2tELQPXQw3vWGNRoStR-4,3963
2
- ocr_stringdist-1.0.0.dist-info/WHEEL,sha256=FluwvplnLTdP5a6iTRVk79q1kl0QHijDLCcqSF4Wei0,105
3
- ocr_stringdist-1.0.0.dist-info/licenses/LICENSE,sha256=5BPRcjlnbl2t4TidSgpfGrtC_birSf8JlZfA-qmVoQE,1072
1
+ ocr_stringdist-1.0.1.dist-info/METADATA,sha256=86GHCkU8E3oyRoN14UPF_PJM55eD7_1NIVppBRr62Ro,3963
2
+ ocr_stringdist-1.0.1.dist-info/WHEEL,sha256=FluwvplnLTdP5a6iTRVk79q1kl0QHijDLCcqSF4Wei0,105
3
+ ocr_stringdist-1.0.1.dist-info/licenses/LICENSE,sha256=5BPRcjlnbl2t4TidSgpfGrtC_birSf8JlZfA-qmVoQE,1072
4
4
  ocr_stringdist.libs/libgcc_s-27e5a392.so.1,sha256=x5sO63liVwXxrjGGP371wB0RyQe1KEnIynYm82T0G0M,449745
5
- ocr_stringdist/__init__.py,sha256=mL-19TkQQElK5B6iVFCV7vjKVal-6JcsBOFKwiCPQnA,284
6
- ocr_stringdist/_rust_stringdist.cpython-313-i386-linux-musl.so,sha256=RM36Ip39T92gQdh9GdQ4CBidSCBRfQXclFCxHjtwy5Y,776649
5
+ ocr_stringdist/__init__.py,sha256=tU-70gwq3CAJ9nZdDSM-C59ShuDE4ClNYEPAkbntYeQ,347
6
+ ocr_stringdist/_rust_stringdist.cpython-313-i386-linux-musl.so,sha256=Z2ZmgqDABGojm4TOTKQ-tmpmFjeC6fI_jUjq0jCsFqs,776649
7
7
  ocr_stringdist/default_ocr_distances.py,sha256=oSu-TpHjPA4jxKpLAfmap8z0ZsC99jsOjnRVHW7Hj_Y,1033
8
- ocr_stringdist/edit_operation.py,sha256=EgEc-2_nOwLUZDOWtogYqKLXIQJxOd9sIAbcGkn-TMY,395
8
+ ocr_stringdist/edit_operation.py,sha256=JjCZulSwZpXLnLL3xcuz2j8EUzNQM9_hNxxVdCHMkvQ,478
9
9
  ocr_stringdist/learner.py,sha256=3qWvqHrAWm4seuwmBmFN4InRL20u8HnPATHjCTnU3I0,10491
10
- ocr_stringdist/levenshtein.py,sha256=t05FicwL5WTTsRSzDa92v79D2LpDiEUOYG_6te8oT28,9854
10
+ ocr_stringdist/levenshtein.py,sha256=m4WAh5iaQefDIQXzqcgC4XcCXntb7zNKhyWAx8A1yOs,9852
11
11
  ocr_stringdist/matching.py,sha256=28Xt-x_V_iVsohD3F64MfZ0mys4_qOZXTIAcmSOE0dA,3270
12
12
  ocr_stringdist/protocols.py,sha256=IyvGzzktPgmPRZyDRE0UKCYo4C0tdewU8IgwFbxZLls,265
13
13
  ocr_stringdist/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
- ocr_stringdist-1.0.0.dist-info/RECORD,,
14
+ ocr_stringdist-1.0.1.dist-info/RECORD,,