# Cloud Natural Language V2 API - Class Google::Cloud::Language::V2::TextSpan (v1.5.0)

1.5.0 (latest) 1.4.0 1.3.0 1.2.1 1.1.0 1.0.1 0.7.0 0.6.0 0.5.1 0.4.0 0.3.2 0.2.0 0.1.0 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

    def begin_offset() -> ::Integer

**Returns**

- (::Integer) --- The API calculates the beginning offset of the content in the original document according to the [EncodingType](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-language-v2/latest/Google-Cloud-Language-V2-EncodingType "Google::Cloud::Language::V2::EncodingType (module)") specified in the API request.

### #begin_offset=

    def begin_offset=(value) -> ::Integer

**Parameter**

- **value** (::Integer) --- The API calculates the beginning offset of the content in the original document according to the [EncodingType](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-language-v2/latest/Google-Cloud-Language-V2-EncodingType "Google::Cloud::Language::V2::EncodingType (module)") specified in the API request.
**Returns**

- (::Integer) --- The API calculates the beginning offset of the content in the original document according to the [EncodingType](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-language-v2/latest/Google-Cloud-Language-V2-EncodingType "Google::Cloud::Language::V2::EncodingType (module)") specified in the API request.

### #content

    def content() -> ::String

**Returns**

- (::String) --- The content of the text span, which is a substring of the document.

### #content=

    def content=(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.