DocumentLine Class

A content line object representing the content found on a single line of the document.

Inheritance
builtins.object
DocumentLine

Constructor

DocumentLine(**kwargs: Any)

Methods

from_dict

Converts a dict in the shape of a DocumentLine to the model itself.

get_words

Get the words found in the spans of this DocumentLine.

to_dict

Returns a dict representation of DocumentLine.

from_dict

Converts a dict in the shape of a DocumentLine to the model itself.

from_dict(data: Dict) -> DocumentLine

Parameters

Name Description
data
Required

A dictionary in the shape of DocumentLine.

Returns

Type Description

DocumentLine

get_words

Get the words found in the spans of this DocumentLine.

get_words() -> Iterable[DocumentWord]

Returns

Type Description
<xref:iterable>[DocumentWord]

iterable[DocumentWord]

to_dict

Returns a dict representation of DocumentLine.

to_dict() -> Dict

Returns

Type Description

dict

Attributes

content

Concatenated content of the contained elements in reading order.

content: str

polygon

Bounding polygon of the line.

polygon: Sequence[Point]

spans

Location of the line in the reading order concatenated content.

spans: List[DocumentSpan]