/* * Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.textract.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *

* A Block represents items that are recognized in a document within a group of pixels close to each other. * The information returned in a Block object depends on the type of operation. In text detection for * documents (for example DetectDocumentText), you get information about the detected words and lines of text. In * text analysis (for example AnalyzeDocument), you can also get information about the fields, tables, and * selection elements that are detected in the document. *

*

* An array of Block objects is returned by both synchronous and asynchronous operations. In synchronous * operations, such as DetectDocumentText, the array of Block objects is the entire set of results. * In asynchronous operations, such as GetDocumentAnalysis, the array is returned over one or more responses. *

*

* For more information, see How Amazon * Textract Works. *

* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class Block implements Serializable, Cloneable, StructuredPojo { /** *

* The type of text item that's recognized. In operations for text detection, the following types are returned: *

* *

* In text analysis operations, the following types are returned: *

* */ private String blockType; /** *

* The confidence score that Amazon Textract has in the accuracy of the recognized text and the accuracy of the * geometry points around the recognized text. *

*/ private Float confidence; /** *

* The word or line of text that's recognized by Amazon Textract. *

*/ private String text; /** *

* The kind of text that Amazon Textract has detected. Can check for handwritten text and printed text. *

*/ private String textType; /** *

* The row in which a table cell is located. The first row position is 1. RowIndex isn't returned by * DetectDocumentText and GetDocumentTextDetection. *

*/ private Integer rowIndex; /** *

* The column in which a table cell appears. The first column position is 1. ColumnIndex isn't returned * by DetectDocumentText and GetDocumentTextDetection. *

*/ private Integer columnIndex; /** *

* The number of rows that a table cell spans. RowSpan isn't returned by * DetectDocumentText and GetDocumentTextDetection. *

*/ private Integer rowSpan; /** *

* The number of columns that a table cell spans. ColumnSpan isn't returned by * DetectDocumentText and GetDocumentTextDetection. *

*/ private Integer columnSpan; /** *

* The location of the recognized text on the image. It includes an axis-aligned, coarse bounding box that surrounds * the text, and a finer-grain polygon for more accurate spatial information. *

*/ private Geometry geometry; /** *

* The identifier for the recognized text. The identifier is only unique for a single operation. *

*/ private String id; /** *

* A list of relationship objects that describe how blocks are related to each other. For example, a LINE block * object contains a CHILD relationship type with the WORD blocks that make up the line of text. There aren't * Relationship objects in the list for relationships that don't exist, such as when the current block has no child * blocks. *

*/ private java.util.List relationships; /** *

* The type of entity. *

*

* The following entity types can be returned by FORMS analysis: *

* *

* The following entity types can be returned by TABLES analysis: *

* *

* EntityTypes isn't returned by DetectDocumentText and * GetDocumentTextDetection. *

*/ private java.util.List entityTypes; /** *

* The selection status of a selection element, such as an option button or check box. *

*/ private String selectionStatus; /** *

* The page on which a block was detected. Page is returned by synchronous and asynchronous operations. * Page values greater than 1 are only returned for multipage documents that are in PDF or TIFF format. A scanned * image (JPEG/PNG) provided to an asynchronous operation, even if it contains multiple document pages, is * considered a single-page document. This means that for scanned images the value of Page is always 1. * Synchronous operations will also return a Page value of 1 because every input document is considered * to be a single-page document. *

*/ private Integer page; /**

*/ private Query query; /** *

* The type of text item that's recognized. In operations for text detection, the following types are returned: *

* *

* In text analysis operations, the following types are returned: *

* * * @param blockType * The type of text item that's recognized. In operations for text detection, the following types are * returned:

* *

* In text analysis operations, the following types are returned: *

*