/*
* Copyright 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.
*/
/*
* Do not modify this file. This file is generated from the textract-2018-06-27.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.Textract.Model
{
///
/// 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.
///
///
public partial class Block
{
private BlockType _blockType;
private int? _columnIndex;
private int? _columnSpan;
private float? _confidence;
private List _entityTypes = new List();
private Geometry _geometry;
private string _id;
private int? _page;
private Query _query;
private List _relationships = new List();
private int? _rowIndex;
private int? _rowSpan;
private SelectionStatus _selectionStatus;
private string _text;
private TextType _textType;
///
/// Gets and sets the property BlockType.
///
/// The type of text item that's recognized. In operations for text detection, the following
/// types are returned:
///
/// -
///
/// PAGE - Contains a list of the LINE
Block
objects that are detected
/// on a document page.
///
/// -
///
/// WORD - A word detected on a document page. A word is one or more ISO basic
/// Latin script characters that aren't separated by spaces.
///
///
-
///
/// LINE - A string of tab-delimited, contiguous words that are detected on a
/// document page.
///
///
///
/// In text analysis operations, the following types are returned:
///
/// -
///
/// PAGE - Contains a list of child
Block
objects that are detected
/// on a document page.
///
/// -
///
/// KEY_VALUE_SET - Stores the KEY and VALUE
Block
objects for linked
/// text that's detected on a document page. Use the EntityType
field to
/// determine if a KEY_VALUE_SET object is a KEY Block
object or a VALUE
/// Block
object.
///
/// -
///
/// WORD - A word that's detected on a document page. A word is one or more ISO
/// basic Latin script characters that aren't separated by spaces.
///
///
-
///
/// LINE - A string of tab-delimited, contiguous words that are detected on a
/// document page.
///
///
-
///
/// TABLE - A table that's detected on a document page. A table is grid-based
/// information with two or more rows or columns, with a cell span of one row and one
/// column each.
///
///
-
///
/// TABLE_TITLE - The title of a table. A title is typically a line of text above
/// or below a table, or embedded as the first row of a table.
///
///
-
///
/// TABLE_FOOTER - The footer associated with a table. A footer is typically a
/// line or lines of text below a table or embedded as the last row of a table.
///
///
-
///
/// CELL - A cell within a detected table. The cell is the parent of the block
/// that contains the text in the cell.
///
///
-
///
/// MERGED_CELL - A cell in a table whose content spans more than one row or column.
/// The
Relationships
array for this cell contain data from individual cells.
///
/// -
///
/// SELECTION_ELEMENT - A selection element such as an option button (radio button)
/// or a check box that's detected on a document page. Use the value of
SelectionStatus
/// to determine the status of the selection element.
///
/// -
///
/// SIGNATURE - The location and confidene score of a signature detected on a
/// document page. Can be returned as part of a Key-Value pair or a detected cell.
///
///
-
///
/// QUERY - A question asked during the call of AnalyzeDocument. Contains an alias
/// and an ID that attaches it to its answer.
///
///
-
///
/// QUERY_RESULT - A response to a question asked during the call of analyze document.
/// Comes with an alias and ID for ease of locating in a response. Also contains location
/// and confidence score.
///
///
///
public BlockType BlockType
{
get { return this._blockType; }
set { this._blockType = value; }
}
// Check to see if BlockType property is set
internal bool IsSetBlockType()
{
return this._blockType != null;
}
///
/// Gets and sets the property ColumnIndex.
///
/// The column in which a table cell appears. The first column position is 1. ColumnIndex
/// isn't returned by DetectDocumentText
and GetDocumentTextDetection
.
///
///
[AWSProperty(Min=0)]
public int ColumnIndex
{
get { return this._columnIndex.GetValueOrDefault(); }
set { this._columnIndex = value; }
}
// Check to see if ColumnIndex property is set
internal bool IsSetColumnIndex()
{
return this._columnIndex.HasValue;
}
///
/// Gets and sets the property ColumnSpan.
///
/// The number of columns that a table cell spans. ColumnSpan
isn't returned
/// by DetectDocumentText
and GetDocumentTextDetection
.
///
///
[AWSProperty(Min=0)]
public int ColumnSpan
{
get { return this._columnSpan.GetValueOrDefault(); }
set { this._columnSpan = value; }
}
// Check to see if ColumnSpan property is set
internal bool IsSetColumnSpan()
{
return this._columnSpan.HasValue;
}
///
/// Gets and sets the property Confidence.
///
/// 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.
///
///
[AWSProperty(Min=0, Max=100)]
public float Confidence
{
get { return this._confidence.GetValueOrDefault(); }
set { this._confidence = value; }
}
// Check to see if Confidence property is set
internal bool IsSetConfidence()
{
return this._confidence.HasValue;
}
///
/// Gets and sets the property EntityTypes.
///
/// The type of entity.
///
///
///
/// The following entity types can be returned by FORMS analysis:
///
/// -
///
/// KEY - An identifier for a field on the document.
///
///
-
///
/// VALUE - The field text.
///
///
///
/// The following entity types can be returned by TABLES analysis:
///
/// -
///
/// COLUMN_HEADER - Identifies a cell that is a header of a column.
///
///
-
///
/// TABLE_TITLE - Identifies a cell that is a title within the table.
///
///
-
///
/// TABLE_SECTION_TITLE - Identifies a cell that is a title of a section within
/// a table. A section title is a cell that typically spans an entire row above a section.
///
///
///
-
///
/// TABLE_FOOTER - Identifies a cell that is a footer of a table.
///
///
-
///
/// TABLE_SUMMARY - Identifies a summary cell of a table. A summary cell can be
/// a row of a table or an additional, smaller table that contains summary information
/// for another table.
///
///
-
///
/// STRUCTURED_TABLE - Identifies a table with column headers where the content
/// of each row corresponds to the headers.
///
///
-
///
/// SEMI_STRUCTURED_TABLE - Identifies a non-structured table.
///
///
///
/// EntityTypes
isn't returned by DetectDocumentText
and GetDocumentTextDetection
.
///
///
public List EntityTypes
{
get { return this._entityTypes; }
set { this._entityTypes = value; }
}
// Check to see if EntityTypes property is set
internal bool IsSetEntityTypes()
{
return this._entityTypes != null && this._entityTypes.Count > 0;
}
///
/// Gets and sets the property Geometry.
///
/// 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.
///
///
public Geometry Geometry
{
get { return this._geometry; }
set { this._geometry = value; }
}
// Check to see if Geometry property is set
internal bool IsSetGeometry()
{
return this._geometry != null;
}
///
/// Gets and sets the property Id.
///
/// The identifier for the recognized text. The identifier is only unique for a single
/// operation.
///
///
public string Id
{
get { return this._id; }
set { this._id = value; }
}
// Check to see if Id property is set
internal bool IsSetId()
{
return this._id != null;
}
///
/// Gets and sets the property Page.
///
/// 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.
///
///
[AWSProperty(Min=0)]
public int Page
{
get { return this._page.GetValueOrDefault(); }
set { this._page = value; }
}
// Check to see if Page property is set
internal bool IsSetPage()
{
return this._page.HasValue;
}
///
/// Gets and sets the property Query.
///
public Query Query
{
get { return this._query; }
set { this._query = value; }
}
// Check to see if Query property is set
internal bool IsSetQuery()
{
return this._query != null;
}
///
/// Gets and sets the property Relationships.
///
/// 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.
///
///
public List Relationships
{
get { return this._relationships; }
set { this._relationships = value; }
}
// Check to see if Relationships property is set
internal bool IsSetRelationships()
{
return this._relationships != null && this._relationships.Count > 0;
}
///
/// Gets and sets the property RowIndex.
///
/// The row in which a table cell is located. The first row position is 1. RowIndex
/// isn't returned by DetectDocumentText
and GetDocumentTextDetection
.
///
///
[AWSProperty(Min=0)]
public int RowIndex
{
get { return this._rowIndex.GetValueOrDefault(); }
set { this._rowIndex = value; }
}
// Check to see if RowIndex property is set
internal bool IsSetRowIndex()
{
return this._rowIndex.HasValue;
}
///
/// Gets and sets the property RowSpan.
///
/// The number of rows that a table cell spans. RowSpan
isn't returned by
/// DetectDocumentText
and GetDocumentTextDetection
.
///
///
[AWSProperty(Min=0)]
public int RowSpan
{
get { return this._rowSpan.GetValueOrDefault(); }
set { this._rowSpan = value; }
}
// Check to see if RowSpan property is set
internal bool IsSetRowSpan()
{
return this._rowSpan.HasValue;
}
///
/// Gets and sets the property SelectionStatus.
///
/// The selection status of a selection element, such as an option button or check box.
///
///
///
public SelectionStatus SelectionStatus
{
get { return this._selectionStatus; }
set { this._selectionStatus = value; }
}
// Check to see if SelectionStatus property is set
internal bool IsSetSelectionStatus()
{
return this._selectionStatus != null;
}
///
/// Gets and sets the property Text.
///
/// The word or line of text that's recognized by Amazon Textract.
///
///
public string Text
{
get { return this._text; }
set { this._text = value; }
}
// Check to see if Text property is set
internal bool IsSetText()
{
return this._text != null;
}
///
/// Gets and sets the property TextType.
///
/// The kind of text that Amazon Textract has detected. Can check for handwritten text
/// and printed text.
///
///
public TextType TextType
{
get { return this._textType; }
set { this._textType = value; }
}
// Check to see if TextType property is set
internal bool IsSetTextType()
{
return this._textType != null;
}
}
}