public static final class TextAnnotation.Builder extends GeneratedMessageV3.Builder<TextAnnotation.Builder> implements TextAnnotationOrBuilder
TextAnnotation contains a structured representation of OCR extracted text.
The hierarchy of an OCR extracted text structure is like this:
TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol
Each structural component, starting from Page, may further have their own
properties. Properties describe detected languages, breaks etc.. Please refer
to the
TextAnnotation.TextProperty
message definition below for more detail.
Protobuf type google.cloud.vision.v1p1beta1.TextAnnotation
Inherited Members
com.google.protobuf.GeneratedMessageV3.Builder.getUnknownFieldSetBuilder()
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownLengthDelimitedField(int,com.google.protobuf.ByteString)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownVarintField(int,int)
com.google.protobuf.GeneratedMessageV3.Builder.parseUnknownField(com.google.protobuf.CodedInputStream,com.google.protobuf.ExtensionRegistryLite,int)
com.google.protobuf.GeneratedMessageV3.Builder.setUnknownFieldSetBuilder(com.google.protobuf.UnknownFieldSet.Builder)
Static Methods
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Methods
addAllPages(Iterable<? extends Page> values)
public TextAnnotation.Builder addAllPages(Iterable<? extends Page> values)
List of pages detected by OCR.
repeated .google.cloud.vision.v1p1beta1.Page pages = 1;
Parameter |
---|
Name | Description |
values | Iterable<? extends com.google.cloud.vision.v1p1beta1.Page>
|
addPages(Page value)
public TextAnnotation.Builder addPages(Page value)
List of pages detected by OCR.
repeated .google.cloud.vision.v1p1beta1.Page pages = 1;
Parameter |
---|
Name | Description |
value | Page
|
addPages(Page.Builder builderForValue)
public TextAnnotation.Builder addPages(Page.Builder builderForValue)
List of pages detected by OCR.
repeated .google.cloud.vision.v1p1beta1.Page pages = 1;
addPages(int index, Page value)
public TextAnnotation.Builder addPages(int index, Page value)
List of pages detected by OCR.
repeated .google.cloud.vision.v1p1beta1.Page pages = 1;
Parameters |
---|
Name | Description |
index | int
|
value | Page
|
addPages(int index, Page.Builder builderForValue)
public TextAnnotation.Builder addPages(int index, Page.Builder builderForValue)
List of pages detected by OCR.
repeated .google.cloud.vision.v1p1beta1.Page pages = 1;
addPagesBuilder()
public Page.Builder addPagesBuilder()
List of pages detected by OCR.
repeated .google.cloud.vision.v1p1beta1.Page pages = 1;
addPagesBuilder(int index)
public Page.Builder addPagesBuilder(int index)
List of pages detected by OCR.
repeated .google.cloud.vision.v1p1beta1.Page pages = 1;
Parameter |
---|
Name | Description |
index | int
|
addRepeatedField(Descriptors.FieldDescriptor field, Object value)
public TextAnnotation.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Overrides
build()
public TextAnnotation build()
buildPartial()
public TextAnnotation buildPartial()
clear()
public TextAnnotation.Builder clear()
Overrides
clearField(Descriptors.FieldDescriptor field)
public TextAnnotation.Builder clearField(Descriptors.FieldDescriptor field)
Overrides
clearOneof(Descriptors.OneofDescriptor oneof)
public TextAnnotation.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Overrides
clearPages()
public TextAnnotation.Builder clearPages()
List of pages detected by OCR.
repeated .google.cloud.vision.v1p1beta1.Page pages = 1;
clearText()
public TextAnnotation.Builder clearText()
UTF-8 text detected on the pages.
string text = 2;
clone()
public TextAnnotation.Builder clone()
Overrides
getDefaultInstanceForType()
public TextAnnotation getDefaultInstanceForType()
getDescriptorForType()
public Descriptors.Descriptor getDescriptorForType()
Overrides
getPages(int index)
public Page getPages(int index)
List of pages detected by OCR.
repeated .google.cloud.vision.v1p1beta1.Page pages = 1;
Parameter |
---|
Name | Description |
index | int
|
Returns |
---|
Type | Description |
Page | |
getPagesBuilder(int index)
public Page.Builder getPagesBuilder(int index)
List of pages detected by OCR.
repeated .google.cloud.vision.v1p1beta1.Page pages = 1;
Parameter |
---|
Name | Description |
index | int
|
getPagesBuilderList()
public List<Page.Builder> getPagesBuilderList()
List of pages detected by OCR.
repeated .google.cloud.vision.v1p1beta1.Page pages = 1;
getPagesCount()
public int getPagesCount()
List of pages detected by OCR.
repeated .google.cloud.vision.v1p1beta1.Page pages = 1;
Returns |
---|
Type | Description |
int | |
getPagesList()
public List<Page> getPagesList()
List of pages detected by OCR.
repeated .google.cloud.vision.v1p1beta1.Page pages = 1;
getPagesOrBuilder(int index)
public PageOrBuilder getPagesOrBuilder(int index)
List of pages detected by OCR.
repeated .google.cloud.vision.v1p1beta1.Page pages = 1;
Parameter |
---|
Name | Description |
index | int
|
getPagesOrBuilderList()
public List<? extends PageOrBuilder> getPagesOrBuilderList()
List of pages detected by OCR.
repeated .google.cloud.vision.v1p1beta1.Page pages = 1;
Returns |
---|
Type | Description |
List<? extends com.google.cloud.vision.v1p1beta1.PageOrBuilder> | |
getText()
UTF-8 text detected on the pages.
string text = 2;
Returns |
---|
Type | Description |
String | The text.
|
getTextBytes()
public ByteString getTextBytes()
UTF-8 text detected on the pages.
string text = 2;
Returns |
---|
Type | Description |
ByteString | The bytes for text.
|
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Overrides
isInitialized()
public final boolean isInitialized()
Overrides
mergeFrom(TextAnnotation other)
public TextAnnotation.Builder mergeFrom(TextAnnotation other)
mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
public TextAnnotation.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Overrides
mergeFrom(Message other)
public TextAnnotation.Builder mergeFrom(Message other)
Parameter |
---|
Name | Description |
other | Message
|
Overrides
mergeUnknownFields(UnknownFieldSet unknownFields)
public final TextAnnotation.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Overrides
removePages(int index)
public TextAnnotation.Builder removePages(int index)
List of pages detected by OCR.
repeated .google.cloud.vision.v1p1beta1.Page pages = 1;
Parameter |
---|
Name | Description |
index | int
|
setField(Descriptors.FieldDescriptor field, Object value)
public TextAnnotation.Builder setField(Descriptors.FieldDescriptor field, Object value)
Overrides
setPages(int index, Page value)
public TextAnnotation.Builder setPages(int index, Page value)
List of pages detected by OCR.
repeated .google.cloud.vision.v1p1beta1.Page pages = 1;
Parameters |
---|
Name | Description |
index | int
|
value | Page
|
setPages(int index, Page.Builder builderForValue)
public TextAnnotation.Builder setPages(int index, Page.Builder builderForValue)
List of pages detected by OCR.
repeated .google.cloud.vision.v1p1beta1.Page pages = 1;
setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
public TextAnnotation.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Overrides
setText(String value)
public TextAnnotation.Builder setText(String value)
UTF-8 text detected on the pages.
string text = 2;
Parameter |
---|
Name | Description |
value | String
The text to set.
|
setTextBytes(ByteString value)
public TextAnnotation.Builder setTextBytes(ByteString value)
UTF-8 text detected on the pages.
string text = 2;
Parameter |
---|
Name | Description |
value | ByteString
The bytes for text to set.
|
setUnknownFields(UnknownFieldSet unknownFields)
public final TextAnnotation.Builder setUnknownFields(UnknownFieldSet unknownFields)
Overrides