mistocr 0.1.4__py3-none-any.whl → 0.1.5__py3-none-any.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.
mistocr/__init__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.1.4"
1
+ __version__ = "0.1.5"
mistocr/refine.py CHANGED
@@ -115,7 +115,6 @@ def apply_hdg_fixes(
115
115
  lut_fixes: dict[str, str], # Lookup table of fixes
116
116
  ) -> str: # Page with fixes applied
117
117
  "Apply the fixes to the page"
118
- #for old in get_hdgs(p): p = p.replace(old, lut_fixes.get(old, old) + (f' .... page {pg}' if pg else ''))
119
118
  for old in get_hdgs(p): p = p.replace(old, lut_fixes.get(old, old))
120
119
  return p
121
120
 
@@ -128,6 +127,7 @@ def fix_md_hdgs(
128
127
  "Fix heading hierarchy in markdown document"
129
128
  src_path,dst_path = Path(src),Path(dst) if dst else Path(src)
130
129
  if dst_path != src_path: dst_path.mkdir(parents=True, exist_ok=True)
131
- lut = mk_fixes_lut(get_hdgs(read_pgs(src_path)), model)
132
- for i,p in enumerate(read_pgs_pg(src_path), 1):
130
+ pgs_with_pg = read_pgs_pg(src_path)
131
+ lut = mk_fixes_lut(L([get_hdgs(pg) for pg in pgs_with_pg]).concat(), model)
132
+ for i,p in enumerate(pgs_with_pg, 1):
133
133
  (dst_path/f'page_{i}.md').write_text(apply_hdg_fixes(p, lut))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mistocr
3
- Version: 0.1.4
3
+ Version: 0.1.5
4
4
  Summary: Simple batch OCR for PDFs using Mistral's state-of-the-art vision model
5
5
  Home-page: https://github.com/franckalbinet/mistocr
6
6
  Author: Solveit
@@ -0,0 +1,10 @@
1
+ mistocr/__init__.py,sha256=rPSfWgIeq2YWVPyESOAwCBt8vftsTpIkuLAGDEzyRQc,22
2
+ mistocr/_modidx.py,sha256=sZ3ISGF-2f7VEOD9MVgqMVs5SifUNe-1YP0wy8Ey0cU,2884
3
+ mistocr/core.py,sha256=wtaYZ_Fz0dXIb1cYLAtymwR9Z7_KBI4ULy-UpM3YTX4,7154
4
+ mistocr/refine.py,sha256=314r4MBZRIvUmu6B_dvvq9P4d4a_japKBpsg4wnU9oU,5253
5
+ mistocr-0.1.5.dist-info/licenses/LICENSE,sha256=xV8xoN4VOL0uw9X8RSs2IMuD_Ss_a9yAbtGNeBWZwnw,11337
6
+ mistocr-0.1.5.dist-info/METADATA,sha256=kcrDK0kJadP5Sze0tVzRo-pLWWTJQiEnvwlLpWJZz2o,4848
7
+ mistocr-0.1.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
8
+ mistocr-0.1.5.dist-info/entry_points.txt,sha256=HjAiHozobM-alm_6bTF-ehRr2DD3KYE9PgRngelONOY,36
9
+ mistocr-0.1.5.dist-info/top_level.txt,sha256=LelTYnSpSXLy1Hb1m2YP3gt8luwP-I8KV0NjP_ucdSs,8
10
+ mistocr-0.1.5.dist-info/RECORD,,
@@ -1,10 +0,0 @@
1
- mistocr/__init__.py,sha256=Wzf5T3NBDfhQoTnhnRNHSlAsE0XMqbclXG-M81Vas70,22
2
- mistocr/_modidx.py,sha256=sZ3ISGF-2f7VEOD9MVgqMVs5SifUNe-1YP0wy8Ey0cU,2884
3
- mistocr/core.py,sha256=wtaYZ_Fz0dXIb1cYLAtymwR9Z7_KBI4ULy-UpM3YTX4,7154
4
- mistocr/refine.py,sha256=SMtZ2dvEE5iH8hL86Au8kXRB-M_uewaexB7RhMqpWnw,5313
5
- mistocr-0.1.4.dist-info/licenses/LICENSE,sha256=xV8xoN4VOL0uw9X8RSs2IMuD_Ss_a9yAbtGNeBWZwnw,11337
6
- mistocr-0.1.4.dist-info/METADATA,sha256=k_4gVsWOX_w2pZGHv6G4FipRdWHCm76V2dw1TijpfjM,4848
7
- mistocr-0.1.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
8
- mistocr-0.1.4.dist-info/entry_points.txt,sha256=HjAiHozobM-alm_6bTF-ehRr2DD3KYE9PgRngelONOY,36
9
- mistocr-0.1.4.dist-info/top_level.txt,sha256=LelTYnSpSXLy1Hb1m2YP3gt8luwP-I8KV0NjP_ucdSs,8
10
- mistocr-0.1.4.dist-info/RECORD,,