Class: Google::Apis::LanguageV1::TextSpan

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

Overview

Represents an output piece of text.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ TextSpan

Returns a new instance of TextSpan.



847
848
849
# File 'lib/google/apis/language_v1/classes.rb', line 847

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)


840
841
842
# File 'lib/google/apis/language_v1/classes.rb', line 840

def begin_offset
  @begin_offset
end

#contentString

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

Returns:

  • (String)


845
846
847
# File 'lib/google/apis/language_v1/classes.rb', line 845

def content
  @content
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



852
853
854
855
# File 'lib/google/apis/language_v1/classes.rb', line 852

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