# Cloud Natural Language V1 Client - Class DependencyEdge (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 DependencyEdge.

Represents dependency parse tree information for a token. (For more
information on dependency labels, see
<http://www.aclweb.org/anthology/P13-2017>

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

## Namespace

Google \\ Cloud \\ Language \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ head_token_index` | `int` Represents the head of this token in the dependency tree. This is the index of the token which has an arc going to this token. The index is the position of the token in the array of tokens returned by the API method. If this token is a root token, then the `head_token_index` is its own index. |
| `↳ label` | `int` The parse label for the token. |

### getHeadTokenIndex

Represents the head of this token in the dependency tree.

This is the index of the token which has an arc going to this token.
The index is the position of the token in the array of tokens returned
by the API method. If this token is a root token, then the
`head_token_index` is its own index.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

### setHeadTokenIndex

Represents the head of this token in the dependency tree.

This is the index of the token which has an arc going to this token.
The index is the position of the token in the array of tokens returned
by the API method. If this token is a root token, then the
`head_token_index` is its own index.

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

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

### getLabel

The parse label for the token.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [Label](https://docs.cloud.google.com/php/docs/reference/cloud-language/latest/V1.DependencyEdge.Label). |

### setLabel

The parse label for the token.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [Label](https://docs.cloud.google.com/php/docs/reference/cloud-language/latest/V1.DependencyEdge.Label). |

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