April 2019
Beginner to intermediate
386 pages
11h 20m
English
The LanguageServiceClient instance represents the client application, which connects to a Google server. The Document class encapsulates the text to be processed. The AnalyzeSyntaxRequest instance represents the request that was sent to the server. It used the document with a UTF-16 encoding. The analyzeSyntax method requested the analysis and returned a response contained in the AnalyzeSyntaxResponse instance:
Document document = Document.newBuilder() .setContent(text) .setType(Type.PLAIN_TEXT).build();AnalyzeSyntaxRequest analyzeSyntaxRequest = AnalyzeSyntaxRequest .newBuilder() .setDocument(document) .setEncodingType(EncodingType.UTF16) .build();AnalyzeSyntaxResponse analyzeSyntaxResponse = languageServiceClient .analyzeSyntax(analyzeSyntaxRequest); ...
Read now
Unlock full access