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 \ V1Methods
__construct
Constructor.
Parameters | |
---|---|
Name | Description |
data |
array
Optional. Data for populating the Message object. |
↳ text |
TextSpan
The token text. |
↳ part_of_speech |
PartOfSpeech
Parts of speech tag for this token. |
↳ dependency_edge |
DependencyEdge
Dependency tree parse for this token. |
↳ lemma |
string
Lemma of the token. |
getText
The token text.
Returns | |
---|---|
Type | Description |
TextSpan|null |
hasText
clearText
setText
The token text.
Parameter | |
---|---|
Name | Description |
var |
TextSpan
|
Returns | |
---|---|
Type | Description |
$this |
getPartOfSpeech
Parts of speech tag for this token.
Returns | |
---|---|
Type | Description |
PartOfSpeech|null |
hasPartOfSpeech
clearPartOfSpeech
setPartOfSpeech
Parts of speech tag for this token.
Parameter | |
---|---|
Name | Description |
var |
PartOfSpeech
|
Returns | |
---|---|
Type | Description |
$this |
getDependencyEdge
Dependency tree parse for this token.
Returns | |
---|---|
Type | Description |
DependencyEdge|null |
hasDependencyEdge
clearDependencyEdge
setDependencyEdge
Dependency tree parse for this token.
Parameter | |
---|---|
Name | Description |
var |
DependencyEdge
|
Returns | |
---|---|
Type | Description |
$this |
getLemma
Lemma of the token.
Returns | |
---|---|
Type | Description |
string |
setLemma
Lemma of the token.
Parameter | |
---|---|
Name | Description |
var |
string
|
Returns | |
---|---|
Type | Description |
$this |