public final AnalyzeSyntaxResponse analyzeSyntax(Document document, EncodingType encodingType) {

    AnalyzeSyntaxRequest request =
        AnalyzeSyntaxRequest.newBuilder()
            .setDocument(document)
            .setEncodingType(encodingType)
            .build();
    return analyzeSyntax(request);
  }
public final AnalyzeSyntaxResponse analyzeSyntax ( Document document , EncodingType encodingType ) { AnalyzeSyntaxRequest request = AnalyzeSyntaxRequest . newBuilder ( ) . setDocument ( document ) . setEncodingType ( encodingType ) . build ( ) ; return analyzeSyntax ( request ) ; }
Analyzes the syntax of the text and provides sentence boundaries and tokenization along with
part of speech tags, dependency trees, and other properties.

<p>Sample code:

<pre><code>
try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
Document document = Document.newBuilder().build();
EncodingType encodingType = EncodingType.NONE;
AnalyzeSyntaxResponse response = languageServiceClient.analyzeSyntax(document, encodingType);
}
</code></pre>

@param document Input document.
@param encodingType The encoding type used by the API to calculate offsets.
@throws com.google.api.gax.rpc.ApiException if the remote call fails