Reference documentation and code samples for the Cloud Natural Language V2 API class Google::Cloud::Language::V2::TextSpan.
Represents a text span in the input document.
Inherits
Object
Extended By
Google::Protobuf::MessageExts::ClassMethods
Includes
Google::Protobuf::MessageExts
Methods
#begin_offset
defbegin_offset()->::Integer
Returns
(::Integer) — The API calculates the beginning offset of the content in the original
document according to the
EncodingType specified in the API
request.
#begin_offset=
defbegin_offset=(value)->::Integer
Parameter
value (::Integer) — The API calculates the beginning offset of the content in the original
document according to the
EncodingType specified in the API
request.
Returns
(::Integer) — The API calculates the beginning offset of the content in the original
document according to the
EncodingType specified in the API
request.
#content
defcontent()->::String
Returns
(::String) — The content of the text span, which is a substring of the document.
#content=
defcontent=(value)->::String
Parameter
value (::String) — The content of the text span, which is a substring of the document.
Returns
(::String) — The content of the text span, which is a substring of the document.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Cloud Natural Language V2 API - Class Google::Cloud::Language::V2::TextSpan (v1.1.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.1.0 (latest)](/ruby/docs/reference/google-cloud-language-v2/latest/Google-Cloud-Language-V2-TextSpan)\n- [1.0.1](/ruby/docs/reference/google-cloud-language-v2/1.0.1/Google-Cloud-Language-V2-TextSpan)\n- [0.7.0](/ruby/docs/reference/google-cloud-language-v2/0.7.0/Google-Cloud-Language-V2-TextSpan)\n- [0.6.0](/ruby/docs/reference/google-cloud-language-v2/0.6.0/Google-Cloud-Language-V2-TextSpan)\n- [0.5.1](/ruby/docs/reference/google-cloud-language-v2/0.5.1/Google-Cloud-Language-V2-TextSpan)\n- [0.4.0](/ruby/docs/reference/google-cloud-language-v2/0.4.0/Google-Cloud-Language-V2-TextSpan)\n- [0.3.2](/ruby/docs/reference/google-cloud-language-v2/0.3.2/Google-Cloud-Language-V2-TextSpan)\n- [0.2.0](/ruby/docs/reference/google-cloud-language-v2/0.2.0/Google-Cloud-Language-V2-TextSpan)\n- [0.1.0](/ruby/docs/reference/google-cloud-language-v2/0.1.0/Google-Cloud-Language-V2-TextSpan) \nReference documentation and code samples for the Cloud Natural Language V2 API class Google::Cloud::Language::V2::TextSpan.\n\nRepresents a text span in the input document. \n\nInherits\n--------\n\n- Object \n\nExtended By\n-----------\n\n- Google::Protobuf::MessageExts::ClassMethods \n\nIncludes\n--------\n\n- Google::Protobuf::MessageExts\n\nMethods\n-------\n\n### #begin_offset\n\n def begin_offset() -\u003e ::Integer\n\n**Returns**\n\n- (::Integer) --- The API calculates the beginning offset of the content in the original document according to the [EncodingType](/ruby/docs/reference/google-cloud-language-v2/latest/Google-Cloud-Language-V2-EncodingType \"Google::Cloud::Language::V2::EncodingType (module)\") specified in the API request.\n\n### #begin_offset=\n\n def begin_offset=(value) -\u003e ::Integer\n\n**Parameter**\n\n- **value** (::Integer) --- The API calculates the beginning offset of the content in the original document according to the [EncodingType](/ruby/docs/reference/google-cloud-language-v2/latest/Google-Cloud-Language-V2-EncodingType \"Google::Cloud::Language::V2::EncodingType (module)\") specified in the API request. \n**Returns**\n\n- (::Integer) --- The API calculates the beginning offset of the content in the original document according to the [EncodingType](/ruby/docs/reference/google-cloud-language-v2/latest/Google-Cloud-Language-V2-EncodingType \"Google::Cloud::Language::V2::EncodingType (module)\") specified in the API request.\n\n### #content\n\n def content() -\u003e ::String\n\n**Returns**\n\n- (::String) --- The content of the text span, which is a substring of the document.\n\n### #content=\n\n def content=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- The content of the text span, which is a substring of the document. \n**Returns**\n\n- (::String) --- The content of the text span, which is a substring of the document."]]