Class: Google::Apis::VisionV1::GoogleCloudVisionV1p5beta1Block

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
generated/google/apis/vision_v1/classes.rb,
generated/google/apis/vision_v1/representations.rb,
generated/google/apis/vision_v1/representations.rb

Overview

Logical element on the page.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ GoogleCloudVisionV1p5beta1Block

Returns a new instance of GoogleCloudVisionV1p5beta1Block



8944
8945
8946
# File 'generated/google/apis/vision_v1/classes.rb', line 8944

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#block_typeString

Detected block type (text, image etc) for this block. Corresponds to the JSON property blockType

Returns:

  • (String)


8905
8906
8907
# File 'generated/google/apis/vision_v1/classes.rb', line 8905

def block_type
  @block_type
end

#bounding_boxGoogle::Apis::VisionV1::GoogleCloudVisionV1p5beta1BoundingPoly

A bounding polygon for the detected image annotation. Corresponds to the JSON property boundingBox



8910
8911
8912
# File 'generated/google/apis/vision_v1/classes.rb', line 8910

def bounding_box
  @bounding_box
end

#confidenceFloat

Confidence of the OCR results on the block. Range [0, 1]. Corresponds to the JSON property confidence

Returns:

  • (Float)


8915
8916
8917
# File 'generated/google/apis/vision_v1/classes.rb', line 8915

def confidence
  @confidence
end

#key_value_pairGoogle::Apis::VisionV1::GoogleCloudVisionV1p5beta1KeyValuePair

Proto for a key value pair. Corresponds to the JSON property keyValuePair



8920
8921
8922
# File 'generated/google/apis/vision_v1/classes.rb', line 8920

def key_value_pair
  @key_value_pair
end

#merged_textString

All UTF-8 text detected in this block. This field is by default not returned unless specified in TextDetectionParams.block_filter or DocumentParsingParams.block_filter. Corresponds to the JSON property mergedText

Returns:

  • (String)


8927
8928
8929
# File 'generated/google/apis/vision_v1/classes.rb', line 8927

def merged_text
  @merged_text
end

#paragraphsArray<Google::Apis::VisionV1::GoogleCloudVisionV1p5beta1Paragraph>

List of paragraphs in this block (if this blocks is of type text). Corresponds to the JSON property paragraphs



8932
8933
8934
# File 'generated/google/apis/vision_v1/classes.rb', line 8932

def paragraphs
  @paragraphs
end

#propertyGoogle::Apis::VisionV1::GoogleCloudVisionV1p5beta1TextAnnotationTextProperty

Additional information detected on the structural component. Corresponds to the JSON property property



8937
8938
8939
# File 'generated/google/apis/vision_v1/classes.rb', line 8937

def property
  @property
end

#tableGoogle::Apis::VisionV1::GoogleCloudVisionV1p5beta1Table

A table representation similar to HTML table structure. Corresponds to the JSON property table



8942
8943
8944
# File 'generated/google/apis/vision_v1/classes.rb', line 8942

def table
  @table
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
# File 'generated/google/apis/vision_v1/classes.rb', line 8949

def update!(**args)
  @block_type = args[:block_type] if args.key?(:block_type)
  @bounding_box = args[:bounding_box] if args.key?(:bounding_box)
  @confidence = args[:confidence] if args.key?(:confidence)
  @key_value_pair = args[:key_value_pair] if args.key?(:key_value_pair)
  @merged_text = args[:merged_text] if args.key?(:merged_text)
  @paragraphs = args[:paragraphs] if args.key?(:paragraphs)
  @property = args[:property] if args.key?(:property)
  @table = args[:table] if args.key?(:table)
end