docling-core 2.24.0__py3-none-any.whl → 2.24.1__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.

Potentially problematic release.


This version of docling-core might be problematic. Click here for more details.

@@ -1,5 +1,6 @@
1
1
  """Datastructures for PaginatedDocument."""
2
2
 
3
+ import copy
3
4
  import json
4
5
  import logging
5
6
  import math
@@ -530,10 +531,16 @@ class SegmentedPdfPage(SegmentedPage):
530
531
  """
531
532
  cells = []
532
533
  for page_cell in self.iterate_cells(cell_unit):
533
- cell_bbox = page_cell.to_bounding_box()
534
+ pc = copy.deepcopy(page_cell)
535
+ # Bring cell_bbox coord origin to the same as input bbox.coord_origin:
536
+ if page_cell.rect.coord_origin != bbox.coord_origin:
537
+ if bbox.coord_origin == CoordOrigin.TOPLEFT:
538
+ pc.rect = pc.rect.to_top_left_origin(self.dimension.height)
539
+ elif bbox.coord_origin == CoordOrigin.BOTTOMLEFT:
540
+ pc.rect = pc.rect.to_bottom_left_origin(self.dimension.height)
541
+ cell_bbox = pc.to_bounding_box()
534
542
  if cell_bbox.intersection_over_self(bbox) > ios:
535
- cells.append(page_cell)
536
-
543
+ cells.append(pc)
537
544
  return cells
538
545
 
539
546
  def export_to_dict(self) -> Dict:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: docling-core
3
- Version: 2.24.0
3
+ Version: 2.24.1
4
4
  Summary: A python library to define and validate data types in Docling.
5
5
  Home-page: https://github.com/docling-project
6
6
  License: MIT
@@ -32,7 +32,7 @@ docling_core/types/doc/__init__.py,sha256=bysJn2iwjAHwThSWDPXEdVUUij7p_ax12_nx2_
32
32
  docling_core/types/doc/base.py,sha256=22U1qDlD-2ICmgzbdZrjNayoPHnq4S1ks1GRoqB7y1Q,12542
33
33
  docling_core/types/doc/document.py,sha256=_FJtmp0yh6F_3AVLVN4Xpo7E1hz50gvS_-HrJmp8FOA,128806
34
34
  docling_core/types/doc/labels.py,sha256=0J9Gsqz-jQ4FP2yxs9wOxoTr3qg97BniFX7MJVziUmk,5684
35
- docling_core/types/doc/page.py,sha256=qCXp_s0cY3N1WWkICv6fjH52OVYYbjYiqRQit86FxG4,39989
35
+ docling_core/types/doc/page.py,sha256=s5DxxoS-6RS0gv3C3ZHWqo2RND2j_iksGJStdby6dBw,40466
36
36
  docling_core/types/doc/tokens.py,sha256=fpPtVHfO5RXk8mkqZ7YrW5LyHipg697kbFBNqn6jXQU,9159
37
37
  docling_core/types/doc/utils.py,sha256=SaiQD-WMMooFm1bMqwatU-IGhtG048iKJb-ppnJit_k,2250
38
38
  docling_core/types/gen/__init__.py,sha256=C6TuCfvpSnSL5XDOFMcYHUY2-i08vvfOGRcdu6Af0pI,124
@@ -63,8 +63,8 @@ docling_core/utils/generate_jsonschema.py,sha256=uNX1O5XnjyB5nA66XqZXTt3YbGuR2ty
63
63
  docling_core/utils/legacy.py,sha256=SqNQAxl97aHfoJEsC9vZcMJg5FNkmqKPFi-wdSrnfI0,24442
64
64
  docling_core/utils/validate.py,sha256=aQ11UbFyl8iD_N7yTTZmm_VVeXz8KcCyn3GLXgkfYRM,2049
65
65
  docling_core/utils/validators.py,sha256=azcrndLzhNkTWnbFSu9shJ5D3j_znnLrIFA5R8hzmGU,2798
66
- docling_core-2.24.0.dist-info/LICENSE,sha256=2M9-6EoQ1sxFztTOkXGAtwUDJvnWaAHdB9BYWVwGkIw,1087
67
- docling_core-2.24.0.dist-info/METADATA,sha256=ycw0ioISQ7Uv0rL9_RU5zpsimerhh35wfKv0bul1e9g,5843
68
- docling_core-2.24.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
69
- docling_core-2.24.0.dist-info/entry_points.txt,sha256=oClcdb2L2RKx4jdqUykY16Kum_f0_whwWhGzIodyidc,216
70
- docling_core-2.24.0.dist-info/RECORD,,
66
+ docling_core-2.24.1.dist-info/LICENSE,sha256=2M9-6EoQ1sxFztTOkXGAtwUDJvnWaAHdB9BYWVwGkIw,1087
67
+ docling_core-2.24.1.dist-info/METADATA,sha256=GYkFcQg28UpfzdBadMKZ6AL6V9ezUVTlL50B__Mje5g,5843
68
+ docling_core-2.24.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
69
+ docling_core-2.24.1.dist-info/entry_points.txt,sha256=oClcdb2L2RKx4jdqUykY16Kum_f0_whwWhGzIodyidc,216
70
+ docling_core-2.24.1.dist-info/RECORD,,