pub enum TreeKind {
Text {
label: String,
text: String,
orig: Option<String>,
formatting: Option<Formatting>,
hyperlink: Option<String>,
level: Option<u8>,
list: Option<ListMeta>,
},
Code {
text: String,
orig: Option<String>,
language: Option<String>,
formatting: Option<Formatting>,
hyperlink: Option<String>,
},
Group {
label: String,
name: String,
},
Table {
table: Table,
rich_cells: Vec<(usize, usize, usize)>,
captions: Vec<usize>,
},
Picture {
captions: Vec<usize>,
image: Option<PictureImage>,
classification: Option<String>,
confidence: Option<f64>,
chart: Option<Table>,
dpi: Option<u32>,
},
FieldRegion {
items: Vec<FieldItem>,
},
}Expand description
What an item in the tree is. Mirrors the docling-core item classes the
JSON texts / groups / tables / pictures / field_regions buckets
hold.
Variants§
Text
A TextItem / TitleItem / SectionHeaderItem / ListItem, told
apart by label (text, title, section_header, list_item,
caption, checkbox_selected, checkbox_unselected, …).
Fields
orig: Option<String>docling’s orig when it differs from text (the heading text
before unicode cleanup, say); None = same as text.
formatting: Option<Formatting>Code
A CodeItem.
Fields
language: Option<String>The language hint (a highlighter class token such as python),
mapped onto docling’s CodeLanguageLabel at export; None →
unknown.
formatting: Option<Formatting>Group
A GroupItem: label is docling’s GroupLabel value (inline,
list, section, unspecified, …), name its name (group, list,
ordered list, header-2, rich_cell_group_1_0_3, …).
Table
A TableItem. rich_cells marks the cells docling serialized as a
RichTableCell: (row, col) grid anchor → the group item (a child of
the table) that holds the cell’s content. captions are caption text
items in the tree.
Picture
A PictureItem, its caption text items and optional payload.
classification is a PictureClassificationLabel value written as
the picture’s meta.classification (an HTML <stamp> / <signature>).
Fields
image: Option<PictureImage>confidence: Option<f64>The prediction’s confidence, when the backend writes one: the
DocLang deserializer stamps 1.0; the office and HTML backends
leave it out (None).
FieldRegion
A form key-value region (field_regions / field_items).