mirror of
https://github.com/DS4SD/docling.git
synced 2025-12-08 20:58:11 +00:00
* Rich tables support for HTML backend Signed-off-by: Maksym Lysak <mly@zurich.ibm.com> * Decoupling JATS backend from HTML backend, ways of creating tables changed significantly Signed-off-by: Maksym Lysak <mly@zurich.ibm.com> * updated and added tests Signed-off-by: Maksym Lysak <mly@zurich.ibm.com> * Refactored parse_table_data in html_backend into few smaller functions Signed-off-by: Maksym Lysak <mly@zurich.ibm.com> * Changing scope of few functions in html_backend.py, making them static, when possible Signed-off-by: Maksym Lysak <mly@zurich.ibm.com> * Fix for HTML tables that have tbody and/or thead, now these tables are also properly supported 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>
277 lines
6.5 KiB
JSON
Vendored
277 lines
6.5 KiB
JSON
Vendored
{
|
|
"schema_name": "DoclingDocument",
|
|
"version": "1.7.0",
|
|
"name": "table_02",
|
|
"origin": {
|
|
"mimetype": "text/html",
|
|
"binary_hash": 13259165361873975426,
|
|
"filename": "table_02.html"
|
|
},
|
|
"furniture": {
|
|
"self_ref": "#/furniture",
|
|
"children": [],
|
|
"content_layer": "furniture",
|
|
"name": "_root_",
|
|
"label": "unspecified"
|
|
},
|
|
"body": {
|
|
"self_ref": "#/body",
|
|
"children": [
|
|
{
|
|
"$ref": "#/texts/0"
|
|
}
|
|
],
|
|
"content_layer": "body",
|
|
"name": "_root_",
|
|
"label": "unspecified"
|
|
},
|
|
"groups": [
|
|
{
|
|
"self_ref": "#/groups/0",
|
|
"parent": {
|
|
"$ref": "#/tables/0"
|
|
},
|
|
"children": [
|
|
{
|
|
"$ref": "#/texts/2"
|
|
},
|
|
{
|
|
"$ref": "#/texts/3"
|
|
},
|
|
{
|
|
"$ref": "#/texts/4"
|
|
}
|
|
],
|
|
"content_layer": "body",
|
|
"name": "rich_cell_group_1_0_1",
|
|
"label": "unspecified"
|
|
}
|
|
],
|
|
"texts": [
|
|
{
|
|
"self_ref": "#/texts/0",
|
|
"parent": {
|
|
"$ref": "#/body"
|
|
},
|
|
"children": [
|
|
{
|
|
"$ref": "#/texts/1"
|
|
},
|
|
{
|
|
"$ref": "#/tables/0"
|
|
},
|
|
{
|
|
"$ref": "#/texts/5"
|
|
}
|
|
],
|
|
"content_layer": "body",
|
|
"label": "title",
|
|
"prov": [],
|
|
"orig": "Header",
|
|
"text": "Header"
|
|
},
|
|
{
|
|
"self_ref": "#/texts/1",
|
|
"parent": {
|
|
"$ref": "#/texts/0"
|
|
},
|
|
"children": [],
|
|
"content_layer": "body",
|
|
"label": "text",
|
|
"prov": [],
|
|
"orig": "This is the first paragraph.",
|
|
"text": "This is the first paragraph."
|
|
},
|
|
{
|
|
"self_ref": "#/texts/2",
|
|
"parent": {
|
|
"$ref": "#/groups/0"
|
|
},
|
|
"children": [],
|
|
"content_layer": "body",
|
|
"label": "text",
|
|
"prov": [],
|
|
"orig": "First Paragraph",
|
|
"text": "First Paragraph"
|
|
},
|
|
{
|
|
"self_ref": "#/texts/3",
|
|
"parent": {
|
|
"$ref": "#/groups/0"
|
|
},
|
|
"children": [],
|
|
"content_layer": "body",
|
|
"label": "text",
|
|
"prov": [],
|
|
"orig": "Second Paragraph",
|
|
"text": "Second Paragraph"
|
|
},
|
|
{
|
|
"self_ref": "#/texts/4",
|
|
"parent": {
|
|
"$ref": "#/groups/0"
|
|
},
|
|
"children": [],
|
|
"content_layer": "body",
|
|
"label": "text",
|
|
"prov": [],
|
|
"orig": "Third Paragraph",
|
|
"text": "Third Paragraph"
|
|
},
|
|
{
|
|
"self_ref": "#/texts/5",
|
|
"parent": {
|
|
"$ref": "#/texts/0"
|
|
},
|
|
"children": [],
|
|
"content_layer": "body",
|
|
"label": "text",
|
|
"prov": [],
|
|
"orig": "After table",
|
|
"text": "After table"
|
|
}
|
|
],
|
|
"pictures": [],
|
|
"tables": [
|
|
{
|
|
"self_ref": "#/tables/0",
|
|
"parent": {
|
|
"$ref": "#/texts/0"
|
|
},
|
|
"children": [
|
|
{
|
|
"$ref": "#/groups/0"
|
|
}
|
|
],
|
|
"content_layer": "body",
|
|
"label": "table",
|
|
"prov": [],
|
|
"captions": [],
|
|
"references": [],
|
|
"footnotes": [],
|
|
"data": {
|
|
"table_cells": [
|
|
{
|
|
"row_span": 1,
|
|
"col_span": 1,
|
|
"start_row_offset_idx": 0,
|
|
"end_row_offset_idx": 1,
|
|
"start_col_offset_idx": 0,
|
|
"end_col_offset_idx": 1,
|
|
"text": "A",
|
|
"column_header": false,
|
|
"row_header": false,
|
|
"row_section": false,
|
|
"fillable": false
|
|
},
|
|
{
|
|
"row_span": 1,
|
|
"col_span": 1,
|
|
"start_row_offset_idx": 0,
|
|
"end_row_offset_idx": 1,
|
|
"start_col_offset_idx": 1,
|
|
"end_col_offset_idx": 2,
|
|
"text": "B",
|
|
"column_header": false,
|
|
"row_header": false,
|
|
"row_section": false,
|
|
"fillable": false
|
|
},
|
|
{
|
|
"row_span": 1,
|
|
"col_span": 1,
|
|
"start_row_offset_idx": 1,
|
|
"end_row_offset_idx": 2,
|
|
"start_col_offset_idx": 0,
|
|
"end_col_offset_idx": 1,
|
|
"text": "First Paragraph\nSecond Paragraph\nThird Paragraph",
|
|
"column_header": false,
|
|
"row_header": false,
|
|
"row_section": false,
|
|
"fillable": false,
|
|
"ref": {
|
|
"$ref": "#/groups/0"
|
|
}
|
|
},
|
|
{
|
|
"row_span": 1,
|
|
"col_span": 1,
|
|
"start_row_offset_idx": 1,
|
|
"end_row_offset_idx": 2,
|
|
"start_col_offset_idx": 1,
|
|
"end_col_offset_idx": 2,
|
|
"text": "2...",
|
|
"column_header": false,
|
|
"row_header": false,
|
|
"row_section": false,
|
|
"fillable": false
|
|
}
|
|
],
|
|
"num_rows": 2,
|
|
"num_cols": 2,
|
|
"grid": [
|
|
[
|
|
{
|
|
"row_span": 1,
|
|
"col_span": 1,
|
|
"start_row_offset_idx": 0,
|
|
"end_row_offset_idx": 1,
|
|
"start_col_offset_idx": 0,
|
|
"end_col_offset_idx": 1,
|
|
"text": "A",
|
|
"column_header": false,
|
|
"row_header": false,
|
|
"row_section": false,
|
|
"fillable": false
|
|
},
|
|
{
|
|
"row_span": 1,
|
|
"col_span": 1,
|
|
"start_row_offset_idx": 0,
|
|
"end_row_offset_idx": 1,
|
|
"start_col_offset_idx": 1,
|
|
"end_col_offset_idx": 2,
|
|
"text": "B",
|
|
"column_header": false,
|
|
"row_header": false,
|
|
"row_section": false,
|
|
"fillable": false
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"row_span": 1,
|
|
"col_span": 1,
|
|
"start_row_offset_idx": 1,
|
|
"end_row_offset_idx": 2,
|
|
"start_col_offset_idx": 0,
|
|
"end_col_offset_idx": 1,
|
|
"text": "First Paragraph\nSecond Paragraph\nThird Paragraph",
|
|
"column_header": false,
|
|
"row_header": false,
|
|
"row_section": false,
|
|
"fillable": false
|
|
},
|
|
{
|
|
"row_span": 1,
|
|
"col_span": 1,
|
|
"start_row_offset_idx": 1,
|
|
"end_row_offset_idx": 2,
|
|
"start_col_offset_idx": 1,
|
|
"end_col_offset_idx": 2,
|
|
"text": "2...",
|
|
"column_header": false,
|
|
"row_header": false,
|
|
"row_section": false,
|
|
"fillable": false
|
|
}
|
|
]
|
|
]
|
|
},
|
|
"annotations": []
|
|
}
|
|
],
|
|
"key_value_items": [],
|
|
"form_items": [],
|
|
"pages": {}
|
|
} |