Class: Google::Apis::LanguageV2::TextSpan
- Inherits:
-
Object
- Object
- Google::Apis::LanguageV2::TextSpan
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- lib/google/apis/language_v2/classes.rb,
lib/google/apis/language_v2/representations.rb,
lib/google/apis/language_v2/representations.rb
Overview
Represents a text span in the input document.
Instance Attribute Summary collapse
-
#begin_offset ⇒ Fixnum
The API calculates the beginning offset of the content in the original document according to the EncodingType specified in the API request.
-
#content ⇒ String
The content of the text span, which is a substring of the document.
Instance Method Summary collapse
-
#initialize(**args) ⇒ TextSpan
constructor
A new instance of TextSpan.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ TextSpan
Returns a new instance of TextSpan.
663 664 665 |
# File 'lib/google/apis/language_v2/classes.rb', line 663 def initialize(**args) update!(**args) end |
Instance Attribute Details
#begin_offset ⇒ Fixnum
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
656 657 658 |
# File 'lib/google/apis/language_v2/classes.rb', line 656 def begin_offset @begin_offset end |
#content ⇒ String
The content of the text span, which is a substring of the document.
Corresponds to the JSON property content
661 662 663 |
# File 'lib/google/apis/language_v2/classes.rb', line 661 def content @content end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
668 669 670 671 |
# File 'lib/google/apis/language_v2/classes.rb', line 668 def update!(**args) @begin_offset = args[:begin_offset] if args.key?(:begin_offset) @content = args[:content] if args.key?(:content) end |