Language/src/V1beta2/Gapic/LanguageServiceGapicClient.php
public function annotateText($document, $features, array $optionalArgs = [])
    {
        $request = new AnnotateTextRequest();
        $request->setDocument($document);
        $request->setFeatures($features);
        if (isset($optionalArgs['encodingType'])) {
            $request->setEncodingType($optionalArgs['encodingType']);
        }

        return $this->startCall(
            'AnnotateText',
            AnnotateTextResponse::class,
            $optionalArgs,
            $request
        )->wait();
    }
public function annotateText($document, $features, array $optionalArgs = [])
    {
        $request = new AnnotateTextRequest();
        $request->setDocument($document);
        $request->setFeatures($features);
        if (isset($optionalArgs['encodingType'])) {
            $request->setEncodingType($optionalArgs['encodingType']);
        }

        return $this->startCall(
            'AnnotateText',
            AnnotateTextResponse::class,
            $optionalArgs,
            $request
        )->wait();
    }
public function annotateText ( $ document , $ features , array $ optionalArgs = [ ] ) { $ request = new AnnotateTextRequest ( ) ; $ request -> setDocument ( $ document ) ; $ request -> setFeatures ( $ features ) ; if ( isset ( $ optionalArgs [ 'encodingType' ] ) ) { $ request -> setEncodingType ( $ optionalArgs [ 'encodingType' ] ) ; } return $ this -> startCall ( 'AnnotateText' , AnnotateTextResponse :: class , $ optionalArgs , $ request ) -> wait ( ) ; }
A convenience method that provides all syntax, sentiment, entity, and
classification features in one call.

Sample code:
```
$languageServiceClient = new LanguageServiceClient();
try {
$document = new Document();
$features = new AnnotateTextRequest\Features();
$response = $languageServiceClient->annotateText($document, $features);
} finally {
$languageServiceClient->close();
}
```

@param Document                     $document     Input document.
@param AnnotateTextRequest\Features $features     The enabled features.
@param array                        $optionalArgs {
Optional.

@type int $encodingType
The encoding type used by the API to calculate offsets.
For allowed values, use constants defined on {@see \Google\Cloud\Language\V1beta2\EncodingType}
@type RetrySettings|array $retrySettings
Retry settings to use for this call. Can be a
{@see Google\ApiCore\RetrySettings} object, or an associative array
of retry settings parameters. See the documentation on
{@see Google\ApiCore\RetrySettings} for example usage.
}

@return \Google\Cloud\Language\V1beta2\AnnotateTextResponse

@throws ApiException if the remote call fails
@experimental
A convenience method that provides all syntax sentiment entity and classification features in one call .