# Cloud Natural Language V1 Client - Class Token (1.2.1)

1.2.1 (latest) 1.2.0 1.1.4 1.0.1 0.34.3 0.33.0 0.32.7 0.31.3 0.30.2 0.29.0 0.28.5 Reference documentation and code samples for the Cloud Natural Language V1 Client class Token.

Represents the smallest syntactic building block of the text.

Generated from protobuf message `google.cloud.language.v1.Token`

## Namespace

Google \\ Cloud \\ Language \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ text` | `https://docs.cloud.google.com/php/docs/reference/cloud-language/latest/V1.TextSpan` The token text. |
| `↳ part_of_speech` | `https://docs.cloud.google.com/php/docs/reference/cloud-language/latest/V1.PartOfSpeech` Parts of speech tag for this token. |
| `↳ dependency_edge` | `https://docs.cloud.google.com/php/docs/reference/cloud-language/latest/V1.DependencyEdge` Dependency tree parse for this token. |
| `↳ lemma` | `string` [Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the token. |

### getText

The token text.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-language/latest/V1.TextSpan|null` |   |

### hasText

### clearText

### setText

The token text.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-language/latest/V1.TextSpan` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getPartOfSpeech

Parts of speech tag for this token.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-language/latest/V1.PartOfSpeech|null` |   |

### hasPartOfSpeech

### clearPartOfSpeech

### setPartOfSpeech

Parts of speech tag for this token.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-language/latest/V1.PartOfSpeech` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDependencyEdge

Dependency tree parse for this token.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-language/latest/V1.DependencyEdge|null` |   |

### hasDependencyEdge

### clearDependencyEdge

### setDependencyEdge

Dependency tree parse for this token.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-language/latest/V1.DependencyEdge` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getLemma

[Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the token.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setLemma

[Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the token.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |