Class: Google::Apis::LanguageV1beta1::TextSpan

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

Overview

Represents an output piece of text.

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) ⇒ TextSpan

Returns a new instance of TextSpan



710
711
712
# File 'generated/google/apis/language_v1beta1/classes.rb', line 710

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

Instance Attribute Details

#begin_offsetFixnum

The API calculates the beginning offset of the content in the original document according to the EncodingType specified in the API request. Corresponds to the JSON property beginOffset

Returns:

  • (Fixnum)


703
704
705
# File 'generated/google/apis/language_v1beta1/classes.rb', line 703

def begin_offset
  @begin_offset
end

#contentString

The content of the output text. Corresponds to the JSON property content

Returns:

  • (String)


708
709
710
# File 'generated/google/apis/language_v1beta1/classes.rb', line 708

def content
  @content
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



715
716
717
718
# File 'generated/google/apis/language_v1beta1/classes.rb', line 715

def update!(**args)
  @begin_offset = args[:begin_offset] if args.key?(:begin_offset)
  @content = args[:content] if args.key?(:content)
end