/* * 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.comprehend.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* Information about each word or line of text in the input document. *
** For additional information, see Block in * the Amazon Textract API reference. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class Block implements Serializable, Cloneable, StructuredPojo { /** ** Unique identifier for the block. *
*/ private String id; /** ** The block represents a line of text or one word of text. *
** 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 *
** The word or line of text extracted from the block. *
*/ private String text; /** ** Page number where the block appears. *
*/ private Integer page; /** ** Co-ordinates of the rectangle or polygon that contains the text. *
*/ private Geometry geometry; /** ** A list of child blocks of the current block. For example, a LINE object has child blocks for each WORD block * that's part of the line of text. *
*/ private java.util.List* Unique identifier for the block. *
* * @param id * Unique identifier for the block. */ public void setId(String id) { this.id = id; } /** ** Unique identifier for the block. *
* * @return Unique identifier for the block. */ public String getId() { return this.id; } /** ** Unique identifier for the block. *
* * @param id * Unique identifier for the block. * @return Returns a reference to this object so that method calls can be chained together. */ public Block withId(String id) { setId(id); return this; } /** ** The block represents a line of text or one word of text. *
** 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 *
** 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 *
** The block represents a line of text or one word of text. *
** 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 *
** 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 *
** The block represents a line of text or one word of text. *
** 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 *
** 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 *
** The block represents a line of text or one word of text. *
** 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 *
** 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 *
** The word or line of text extracted from the block. *
* * @param text * The word or line of text extracted from the block. */ public void setText(String text) { this.text = text; } /** ** The word or line of text extracted from the block. *
* * @return The word or line of text extracted from the block. */ public String getText() { return this.text; } /** ** The word or line of text extracted from the block. *
* * @param text * The word or line of text extracted from the block. * @return Returns a reference to this object so that method calls can be chained together. */ public Block withText(String text) { setText(text); return this; } /** ** Page number where the block appears. *
* * @param page * Page number where the block appears. */ public void setPage(Integer page) { this.page = page; } /** ** Page number where the block appears. *
* * @return Page number where the block appears. */ public Integer getPage() { return this.page; } /** ** Page number where the block appears. *
* * @param page * Page number where the block appears. * @return Returns a reference to this object so that method calls can be chained together. */ public Block withPage(Integer page) { setPage(page); return this; } /** ** Co-ordinates of the rectangle or polygon that contains the text. *
* * @param geometry * Co-ordinates of the rectangle or polygon that contains the text. */ public void setGeometry(Geometry geometry) { this.geometry = geometry; } /** ** Co-ordinates of the rectangle or polygon that contains the text. *
* * @return Co-ordinates of the rectangle or polygon that contains the text. */ public Geometry getGeometry() { return this.geometry; } /** ** Co-ordinates of the rectangle or polygon that contains the text. *
* * @param geometry * Co-ordinates of the rectangle or polygon that contains the text. * @return Returns a reference to this object so that method calls can be chained together. */ public Block withGeometry(Geometry geometry) { setGeometry(geometry); return this; } /** ** A list of child blocks of the current block. For example, a LINE object has child blocks for each WORD block * that's part of the line of text. *
* * @return A list of child blocks of the current block. For example, a LINE object has child blocks for each WORD * block that's part of the line of text. */ public java.util.List* A list of child blocks of the current block. For example, a LINE object has child blocks for each WORD block * that's part of the line of text. *
* * @param relationships * A list of child blocks of the current block. For example, a LINE object has child blocks for each WORD * block that's part of the line of text. */ public void setRelationships(java.util.Collection* A list of child blocks of the current block. For example, a LINE object has child blocks for each WORD block * that's part of the line of text. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setRelationships(java.util.Collection)} or {@link #withRelationships(java.util.Collection)} if you want * to override the existing values. *
* * @param relationships * A list of child blocks of the current block. For example, a LINE object has child blocks for each WORD * block that's part of the line of text. * @return Returns a reference to this object so that method calls can be chained together. */ public Block withRelationships(RelationshipsListItem... relationships) { if (this.relationships == null) { setRelationships(new java.util.ArrayList* A list of child blocks of the current block. For example, a LINE object has child blocks for each WORD block * that's part of the line of text. *
* * @param relationships * A list of child blocks of the current block. For example, a LINE object has child blocks for each WORD * block that's part of the line of text. * @return Returns a reference to this object so that method calls can be chained together. */ public Block withRelationships(java.util.Collection