Commit Graph
173 Commits
Author SHA1 Message Date
Peter Staar 5c955e6d75 formatted the code
Signed-off-by: Peter Staar <taa@zurich.ibm.com>
2025-06-05 16:50:54 +02:00
Peter Staar 40aee366bf added script mode
Signed-off-by: Peter Staar <taa@zurich.ibm.com>
2025-06-05 16:38:09 +02:00
Panos Vagenas d8a5256b2c feat: add table annotations (#304)
* feat: add table annotations

Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>

* refactor annotation types

Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>

* expand to HTML

Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>

* introduce annotation serializer

Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>

* Update dummy_doc.yaml

Signed-off-by: Panos Vagenas <35837085+vagenas@users.noreply.github.com>

---------

Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>
Signed-off-by: Panos Vagenas <35837085+vagenas@users.noreply.github.com>
2025-06-05 15:38:46 +02:00
Christoph Auer defd49efae fix: Support section_header levels in doctags deserialization (#313)
Adding support for section_header levels in doctags deserialization

Signed-off-by: Christoph Auer <cau@zurich.ibm.com>
2025-06-03 11:40:13 +02:00
samiucandsamiullahchattha c521766cb7 feat: add BoundingBox methods for overlap and union calculations (#311)
* feat(BoundingBox): add methods for overlap and union calculations

Signed-off-by: samiullahchattha <Sami.Ullah1@ibm.com>

* format files

Signed-off-by: samiullahchattha <Sami.Ullah1@ibm.com>

---------

Signed-off-by: samiullahchattha <Sami.Ullah1@ibm.com>
Co-authored-by: samiullahchattha <Sami.Ullah1@ibm.com>
2025-06-02 10:45:20 +02:00
Panos Vagenas 87b72d6537 fix(HybridChunker): refine max_tokens auto-detection (#306)
Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>
2025-05-27 15:38:49 +02:00
Panos VagenasandMichele Dolfi f067c51c48 feat: add annotations in MD & HTML serialization (#295)
* feat: include annotations in MD & HTML serialization

Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>

* (HTML) move annotations into figcaptions

Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>

* add explicit beginning/end markers, fix case of excluded refs

Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>

* improve annotation marking, extend tests

Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>

* wrap captions (#305)

Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>

* revert temp test changes

Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>

---------

Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>
Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>
Co-authored-by: Michele Dolfi <dol@zurich.ibm.com>
2025-05-27 10:49:13 +02:00
Cesar Berrospi Ramis 4a174b5679 chore: fix deprecation warnings (#303)
* chore: fix deprecation warnings

Signed-off-by: Cesar Berrospi Ramis <75900930+ceberam@users.noreply.github.com>

* chore: disregard deprecated captions from hierarchical chunker in hybrid chunker

Signed-off-by: Cesar Berrospi Ramis <75900930+ceberam@users.noreply.github.com>

* chore: update poetry lock file

Signed-off-by: Cesar Berrospi Ramis <75900930+ceberam@users.noreply.github.com>

---------

Signed-off-by: Cesar Berrospi Ramis <75900930+ceberam@users.noreply.github.com>
2025-05-26 15:58:08 +02:00
Panos Vagenas ebc356a787 fix: fix hybrid chunker legacy patching (#300)
Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>
2025-05-22 13:34:50 +02:00
Panos Vagenas c49a50e76b fix(markdown): fix case of empty page break string (#298)
Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>
2025-05-20 10:51:24 +02:00
Panos Vagenas 6a7eb537eb feat: provide visualizer option in HTML split view (#294)
* feat: provide visualizer option in HTML split view

Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>

* loosen test

Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>

---------

Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>
2025-05-16 11:22:12 +02:00
Christoph Auer aa957cf4b6 fix: Updates for labels and methods to support document GT annotation (#293)
Update labels and get_color

Signed-off-by: Christoph Auer <cau@zurich.ibm.com>
2025-05-14 14:35:17 +02:00
Christoph Auer ad88ecf845 fix: Add unit flags to SegmentedPage (#286)
Add unit flags to SegmentedPage

Signed-off-by: Christoph Auer <cau@zurich.ibm.com>
2025-05-06 14:00:47 +02:00
Peter W. J. Staar 7f83f1ce84 feat: add image group serialization in html (#284)
* feat: add-image group serialization in html

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* reformatted the code

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

---------

Signed-off-by: Peter Staar <taa@zurich.ibm.com>
2025-05-06 13:59:47 +02:00
Said Gürbüz 511fb98a03 fix: update deserialization for better recovery (#282)
update deserialization for better recovery

Signed-off-by: Saidgurbuz <said.gurbuz@epfl.ch>
2025-05-06 10:25:36 +02:00
Peter W. J. Staar 2f0f12160b feat: adding the label picture_group (#283)
* feat: adding the label picture_group

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* renamed group to area

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* reformatted the code

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* reformatted the docs

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

---------

Signed-off-by: Peter Staar <taa@zurich.ibm.com>
2025-05-06 09:43:35 +02:00
Panos Vagenas 7eb9fa96e6 fix: include captions regardless of traverse_pictures flag (#278)
Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>
2025-05-05 10:11:18 +02:00
Michele Dolfi 4b967ab55c fix: hashlib usage for FIPS (#280)
fix usage of hashlib for FIPS

Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>
2025-05-02 15:00:02 +02:00
Panos Vagenas 8677d6e9c6 fix: fix multi-provenance item visualization (#277)
Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>
2025-04-30 15:55:27 +02:00
Panos Vagenas d05fe08546 feat: promote serializers to stable API (#276)
Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>
2025-04-30 11:26:39 +02:00
Rahul Das 591fe59357 fix: added return value for crop_text method in segmentedPdfPage Class (#275)
* Added Return value for crop_text method in segmentedPdfPage Class

Signed-off-by: rahuldas-dev <r.das699@gmail.com>

* fix: added return value of crop_text method along with return type annotation plus doc string

Signed-off-by: rahuldas-dev <r.das699@gmail.com>

---------

Signed-off-by: rahuldas-dev <r.das699@gmail.com>
2025-04-29 13:25:55 +02:00
Said Gürbüz 8f85d056e8 fix: make load_from_doctags method static (#273)
make load_from_doctags method static

Signed-off-by: Saidgurbuz <said.gurbuz@epfl.ch>
2025-04-29 07:52:54 +02:00
Peter W. J. Staar a947440545 fix: visualization of document pages without items (#271)
* fix: visualization of document pages without items

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* reformatted the code

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* fixed MyPy

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* fixed MyPy (2)

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* fixed MyPy (3)

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* fixed flake

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* fixed flake (2)

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

---------

Signed-off-by: Peter Staar <taa@zurich.ibm.com>
2025-04-25 11:41:08 +02:00
Said Gürbüz d9709d0b12 fix: UnboundLocal variable (#269)
fix UnboundLocal variable

Signed-off-by: Saidgurbuz <said.gurbuz@epfl.ch>
2025-04-24 16:51:17 +02:00
Eugene c30ada64d6 chore: Types fixes (#267)
* docs: Recommend installing all groups for mypy to work properly

Signed-off-by: Eugene <fogaprod@gmail.com>

* chore: Fix some incomplete type defs

Signed-off-by: Eugene <fogaprod@gmail.com>

---------

Signed-off-by: Eugene <fogaprod@gmail.com>
2025-04-22 10:29:20 +02:00
GuillermoandPanos Vagenas 763e1364ff feat: Add tiktoken tokenizers support to HybridChunker (#240)
* feat: Add tiktoken tokenizers support to HybridChunker

Signed-off-by: ruizguille <guillermo@codeawake.com>

* separate OpenAI tokenizer

Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>

---------

Signed-off-by: ruizguille <guillermo@codeawake.com>
Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>
Co-authored-by: Panos Vagenas <pva@zurich.ibm.com>
2025-04-18 07:43:20 +02:00
Eugene c19c5164cb chore: typehint DoclingDocument.export_to_dict return type (#264)
Signed-off-by: Eugene <fogaprod@gmail.com>
2025-04-17 12:29:17 +02:00
Panos Vagenas a258d525e1 feat: add visualizers (#263)
* feat: add visualizers

Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>

* make visualizers composable

Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>

* use BoundingRectangle instead of BoundingBox

Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>

* enforce top-left coordinates

Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>

* narrow down test data to first 3 pages

Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>

* add file deletions

Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>

---------

Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>
2025-04-17 11:43:45 +02:00
d0a49da6de fix: HTML serialization for single image documents (#261)
* fix for HTML serialization for single image documents

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* minor refactor, add test

Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>

---------

Signed-off-by: Peter Staar <taa@zurich.ibm.com>
Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>
Co-authored-by: Panos Vagenas <pva@zurich.ibm.com>
Co-authored-by: Panos Vagenas <35837085+vagenas@users.noreply.github.com>
2025-04-16 16:40:27 +02:00
Christoph Auer 159f61d6d8 fix: Safer label color API (#259)
Signed-off-by: Christoph Auer <cau@zurich.ibm.com>
2025-04-15 16:28:10 +02:00
Maxim LysakandMaksym Lysak caa8aeefae feat: Chart tabular data serialization for HTML serializer (#258)
* Add chart tabular data serialization to HTML serializer

Signed-off-by: Maksym Lysak <mly@zurich.ibm.com>

* Fixing pre-commit issues

Signed-off-by: Maksym Lysak <mly@zurich.ibm.com>

* Fixed table serialization for tabular chart data

Signed-off-by: Maksym Lysak <mly@zurich.ibm.com>

* test for loading doctags with chart data

Signed-off-by: Maksym Lysak <mly@zurich.ibm.com>

* Improved loading doctags test with chart example, added tests for chart serialization into html and md

Signed-off-by: Maksym Lysak <mly@zurich.ibm.com>

---------

Signed-off-by: Maksym Lysak <mly@zurich.ibm.com>
Co-authored-by: Maksym Lysak <mly@zurich.ibm.com>
2025-04-15 13:31:50 +02:00
Panos Vagenas 928e5c5046 fix: fix page breaking in case page starts with group (#253)
Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>
2025-04-14 18:12:47 +02:00
Panos Vagenas 15d2f2c1d5 fix: fix code handling in HTML serialization (#251)
Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>
2025-04-14 07:10:14 +02:00
Panos Vagenas 98c60bb65b perf: fix serialization performance (#249)
* perf: fix serialization performance

Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>

* add missing leading HTML tag

Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>

---------

Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>
2025-04-11 15:37:52 +02:00
Panos Vagenas ab78e0bd9c fix: fix page filtering issue (#247)
Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>
2025-04-10 17:04:09 +02:00
Panos Vagenas 26f639d8b8 perf: accelerate span deduplication (#248)
Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>
2025-04-10 17:00:19 +02:00
Peter W. J. Staar 587e67f423 fix: propagate HTMLOutputStyle properly through (#246)
fix to propagate HTMLOutputStyle properly through

Signed-off-by: Peter Staar <taa@zurich.ibm.com>
2025-04-10 11:22:36 +02:00
Peter W. J. StaarandPanos Vagenas 5d406008f2 feat: add HTML serializer (#232)
* iunitial attempt at HTML serializer

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* first version, to be tested thoroughly

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* added the new test

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* rewrote carefully the export-to-html into new framework

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* fixed the inline list-items

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* added the inline code

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* migrated the table html code

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* updated the picture HTML serializer

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* updated the html for Form and KeyValue

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* first version of KeyValue serialisation

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* fixed the key-value and form-region and added the GraphData serializer

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* need to do some mypy work now

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* passed the mypy

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* added the get_excluded_refs function to obtain proper serialization

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* enabled the captions

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* removed empty lists

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* added initial split view and customised styles

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* cleaned up, now waiting for page-indices propagationg

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* updated the styles and parameters with split_page

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* propagated the parameter split_page_view

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* first fully working version

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* removed the prints

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* fixed the tests

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* fixed the tests

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* fixed the tests for html export

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* removed dead code

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* updated the test output

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* fixed the tests

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* reformatted the code

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* rename parameter tag to class_name

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* added serializers to table and picture

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* removed dead code

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* various HTML serialization improvements (#242)

Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>

* added enum for different output styles

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

---------

Signed-off-by: Peter Staar <taa@zurich.ibm.com>
Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>
Co-authored-by: Panos Vagenas <pva@zurich.ibm.com>
2025-04-10 10:59:07 +02:00
Panos Vagenas 23036e17fa feat: add serializer provider to chunkers (#239)
Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>
2025-04-09 12:45:44 +02:00
Clément DoumouroandChristoph Auer 055742c2e8 fix: Better BoundingRectangle.angle and BoundingRectangle.angle_360 computation (#237)
* fix: fix `BoundingRectanble.angle` and `BoundingRectanble.angle_360` computation

Signed-off-by: Clément Doumouro <clement.doumouro@gmail.com>

* fix: compute page bounding rectangle angle between (0-2pi) / (0-360)

Signed-off-by: Clément Doumouro <clement.doumouro@gmail.com>

---------

Signed-off-by: Clément Doumouro <clement.doumouro@gmail.com>
Co-authored-by: Christoph Auer <60343111+cau-git@users.noreply.github.com>
2025-04-08 16:59:10 +02:00
Panos Vagenas 5e4c0fd51f feat: integrate serialization API into chunkers (#221)
Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>
2025-04-08 14:04:40 +02:00
Panos Vagenas 73b99410a9 feat: expose page number in Serialization API (#238)
Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>
2025-04-08 13:17:27 +02:00
Maxim LysakandMaksym Lysak 0482bacb5b feat: Markdown chart serializer (picture+table) (#235)
* Markdown serializer for charts

Signed-off-by: Maksym Lysak <mly@zurich.ibm.com>

* Added serializer parameter disable_chart_tables, that prevents printing of chart table into MarkDown

Signed-off-by: Maksym Lysak <mly@zurich.ibm.com>

* cleaning

Signed-off-by: Maksym Lysak <mly@zurich.ibm.com>

* propagating paramerer disable_chart_tables

Signed-off-by: Maksym Lysak <mly@zurich.ibm.com>

* Updated parameter name from negative to positive notation enable_chart_tables

Signed-off-by: Maksym Lysak <mly@zurich.ibm.com>

---------

Signed-off-by: Maksym Lysak <mly@zurich.ibm.com>
Co-authored-by: Maksym Lysak <mly@zurich.ibm.com>
2025-04-07 15:28:01 +02:00
Maxim LysakandMaksym Lysak e9259a5f87 feat: Support of DocTags charts (serialization and deserialization) (#229)
* Doctags charts deserialization into Docling Document, added PictureTabularChartData

Signed-off-by: Maksym Lysak <mly@zurich.ibm.com>

* Correction for chart label mapping

Signed-off-by: Maksym Lysak <mly@zurich.ibm.com>

* simplified label mapping

Signed-off-by: Maksym Lysak <mly@zurich.ibm.com>

* Improved docummentation comment

Signed-off-by: Maksym Lysak <mly@zurich.ibm.com>

* Added stacked_bar_chart to labels and tokens, as well as adjusted doctags_load

Signed-off-by: Maksym Lysak <mly@zurich.ibm.com>

* doctags serializer for charts

Signed-off-by: Maksym Lysak <mly@zurich.ibm.com>

* - Fixed DocTags table deserialization
- Updated tests

Signed-off-by: Maksym Lysak <mly@zurich.ibm.com>

* cleaning

Signed-off-by: Maksym Lysak <mly@zurich.ibm.com>

* Allowing DocItemLabel.CHART as a label for PictureItem

Signed-off-by: Maksym Lysak <mly@zurich.ibm.com>

---------

Signed-off-by: Maksym Lysak <mly@zurich.ibm.com>
Co-authored-by: Maksym Lysak <mly@zurich.ibm.com>
2025-04-07 12:27:48 +02:00
Peter W. J. StaarandPanos Vagenas f2fe1c1bc6 feat: added initial delete and insert methods in DoclingDocument (#220)
* added intial delete and merge

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* work-in-progress for the delete option

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* working on the delete_document_item

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* reformatted code

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* verified the model-validation

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* reformatted the code

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* fixed the delete item

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* reproducible error in tests

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* before rebase with main

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* updated the tests

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* updated the tests

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* updated the tests (2) and reformatted

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* updated the iterate_items to reduce code duplication

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* mapped path method to _split_ref_to_path

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* made get_parent_ref private method

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* updated with new public functions

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* reformatted code

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* working on the comments of the PR

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* updated the test

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* factored out the internal tests

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* refactored the code and updated the tests

Signed-off-by: Peter Staar <taa@zurich.ibm.com>

* update return types, extend unit test

Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>

* add replace_item test

Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>

* revert unnecessary comments

Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>

---------

Signed-off-by: Peter Staar <taa@zurich.ibm.com>
Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>
Co-authored-by: Panos Vagenas <pva@zurich.ibm.com>
2025-04-04 14:34:25 +02:00
Maxim LysakandMaksym Lysak a055e1a9f0 fix: DocTags import location fix for tables, pictures, captions (#227)
* Fix for the table with captions bboxes

Signed-off-by: Maksym Lysak <mly@zurich.ibm.com>

* cleaned up

Signed-off-by: Maksym Lysak <mly@zurich.ibm.com>

* Correcting caption bbox logic for pictures

Signed-off-by: Maksym Lysak <mly@zurich.ibm.com>

* Added test, small fix with adding caption to the picture when image not available

Signed-off-by: Maksym Lysak <mly@zurich.ibm.com>

* test cases (pictures + png)

Signed-off-by: Maksym Lysak <mly@zurich.ibm.com>

* fixed comment

Signed-off-by: Maksym Lysak <mly@zurich.ibm.com>

* Corrected caption spans for tables and pictures, added check of captions in the tests

Signed-off-by: Maksym Lysak <mly@zurich.ibm.com>

---------

Signed-off-by: Maksym Lysak <mly@zurich.ibm.com>
Co-authored-by: Maksym Lysak <mly@zurich.ibm.com>
2025-04-02 09:52:54 +02:00
Yusik KimandChristoph Auer e0943d24ec feat: allow images in doctags deserializer to be optional and support multipage (#225)
* feat: allow images in doctags deserializer to be optional and support multipage

Signed-off-by: Yusik Kim <kmyusk@gmail.com>

* chore: remove commented out lines

Signed-off-by: Yusik Kim <kmyusk@gmail.com>

* Avoid typecasting

Signed-off-by: Christoph Auer <cau@zurich.ibm.com>

---------

Signed-off-by: Yusik Kim <kmyusk@gmail.com>
Signed-off-by: Christoph Auer <cau@zurich.ibm.com>
Co-authored-by: Christoph Auer <cau@zurich.ibm.com>
2025-03-31 13:32:05 +02:00
Maxim LysakandMaksym Lysak 2f380abd17 fix: DivisionByZero in intersection_over_self (#224)
Preventing intersection_over_self to trhow DivisionByZero when area of the element is zero

Signed-off-by: Maksym Lysak <mly@zurich.ibm.com>
Co-authored-by: Maksym Lysak <mly@zurich.ibm.com>
2025-03-31 13:11:36 +02:00
Panos Vagenas 57d26eed11 fix: fix hyperlink deserialization (#223)
Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>
2025-03-31 11:31:01 +02:00
Maxim LysakandMaksym Lysak 8e0e9b72bf fix: Automatic transformation of output cells bbox coord origin defined by input in get_cells_in_bbox (#219)
* Added automatic transformation of page cell_bbox coord origin to the same as input bbox.coord_origin when requesting get_cells_in_bbox

Signed-off-by: Maksym Lysak <mly@zurich.ibm.com>

* corrected page_cell rect coord origin switch logic

Signed-off-by: Maksym Lysak <mly@zurich.ibm.com>

* avoid modifying original page cells in get_cells_in_bbox, instead make a copy

Signed-off-by: Maksym Lysak <mly@zurich.ibm.com>

---------

Signed-off-by: Maksym Lysak <mly@zurich.ibm.com>
Co-authored-by: Maksym Lysak <mly@zurich.ibm.com>
2025-03-28 14:08:26 +01:00