|
36 | 36 | * <code>
|
37 | 37 | * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) {
|
38 | 38 | * Document document = Document.newBuilder().build();
|
39 |
| - * AnalyzeSentimentResponse response = languageServiceClient.analyzeSentiment(document); |
| 39 | + * EncodingType encodingType = EncodingType.NONE; |
| 40 | + * AnalyzeSentimentResponse response = languageServiceClient.analyzeSentiment(document, encodingType); |
40 | 41 | * }
|
41 | 42 | * </code>
|
42 | 43 | * </pre>
|
@@ -146,6 +147,35 @@ public LanguageServiceStub getStub() {
|
146 | 147 | return stub;
|
147 | 148 | }
|
148 | 149 |
|
| 150 | + // AUTO-GENERATED DOCUMENTATION AND METHOD |
| 151 | + /** |
| 152 | + * Analyzes the sentiment of the provided text. |
| 153 | + * |
| 154 | + * <p>Sample code: |
| 155 | + * |
| 156 | + * <pre><code> |
| 157 | + * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) { |
| 158 | + * Document document = Document.newBuilder().build(); |
| 159 | + * EncodingType encodingType = EncodingType.NONE; |
| 160 | + * AnalyzeSentimentResponse response = languageServiceClient.analyzeSentiment(document, encodingType); |
| 161 | + * } |
| 162 | + * </code></pre> |
| 163 | + * |
| 164 | + * @param document Required. Input document. |
| 165 | + * @param encodingType The encoding type used by the API to calculate sentence offsets for the |
| 166 | + * sentence sentiment. |
| 167 | + * @throws com.google.api.gax.rpc.ApiException if the remote call fails |
| 168 | + */ |
| 169 | + public final AnalyzeSentimentResponse analyzeSentiment( |
| 170 | + Document document, EncodingType encodingType) { |
| 171 | + AnalyzeSentimentRequest request = |
| 172 | + AnalyzeSentimentRequest.newBuilder() |
| 173 | + .setDocument(document) |
| 174 | + .setEncodingType(encodingType) |
| 175 | + .build(); |
| 176 | + return analyzeSentiment(request); |
| 177 | + } |
| 178 | + |
149 | 179 | // AUTO-GENERATED DOCUMENTATION AND METHOD
|
150 | 180 | /**
|
151 | 181 | * Analyzes the sentiment of the provided text.
|
@@ -243,6 +273,29 @@ public final AnalyzeEntitiesResponse analyzeEntities(
|
243 | 273 | return analyzeEntities(request);
|
244 | 274 | }
|
245 | 275 |
|
| 276 | + // AUTO-GENERATED DOCUMENTATION AND METHOD |
| 277 | + /** |
| 278 | + * Finds named entities (currently proper names and common nouns) in the text along with entity |
| 279 | + * types, salience, mentions for each entity, and other properties. |
| 280 | + * |
| 281 | + * <p>Sample code: |
| 282 | + * |
| 283 | + * <pre><code> |
| 284 | + * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) { |
| 285 | + * Document document = Document.newBuilder().build(); |
| 286 | + * AnalyzeEntitiesResponse response = languageServiceClient.analyzeEntities(document); |
| 287 | + * } |
| 288 | + * </code></pre> |
| 289 | + * |
| 290 | + * @param document Required. Input document. |
| 291 | + * @throws com.google.api.gax.rpc.ApiException if the remote call fails |
| 292 | + */ |
| 293 | + public final AnalyzeEntitiesResponse analyzeEntities(Document document) { |
| 294 | + AnalyzeEntitiesRequest request = |
| 295 | + AnalyzeEntitiesRequest.newBuilder().setDocument(document).build(); |
| 296 | + return analyzeEntities(request); |
| 297 | + } |
| 298 | + |
246 | 299 | // AUTO-GENERATED DOCUMENTATION AND METHOD
|
247 | 300 | /**
|
248 | 301 | * Finds named entities (currently proper names and common nouns) in the text along with entity
|
@@ -321,6 +374,30 @@ public final AnalyzeEntitySentimentResponse analyzeEntitySentiment(
|
321 | 374 | return analyzeEntitySentiment(request);
|
322 | 375 | }
|
323 | 376 |
|
| 377 | + // AUTO-GENERATED DOCUMENTATION AND METHOD |
| 378 | + /** |
| 379 | + * Finds entities, similar to |
| 380 | + * [AnalyzeEntities][google.cloud.language.v1beta2.LanguageService.AnalyzeEntities] in the text |
| 381 | + * and analyzes sentiment associated with each entity and its mentions. |
| 382 | + * |
| 383 | + * <p>Sample code: |
| 384 | + * |
| 385 | + * <pre><code> |
| 386 | + * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) { |
| 387 | + * Document document = Document.newBuilder().build(); |
| 388 | + * AnalyzeEntitySentimentResponse response = languageServiceClient.analyzeEntitySentiment(document); |
| 389 | + * } |
| 390 | + * </code></pre> |
| 391 | + * |
| 392 | + * @param document Required. Input document. |
| 393 | + * @throws com.google.api.gax.rpc.ApiException if the remote call fails |
| 394 | + */ |
| 395 | + public final AnalyzeEntitySentimentResponse analyzeEntitySentiment(Document document) { |
| 396 | + AnalyzeEntitySentimentRequest request = |
| 397 | + AnalyzeEntitySentimentRequest.newBuilder().setDocument(document).build(); |
| 398 | + return analyzeEntitySentiment(request); |
| 399 | + } |
| 400 | + |
324 | 401 | // AUTO-GENERATED DOCUMENTATION AND METHOD
|
325 | 402 | /**
|
326 | 403 | * Finds entities, similar to
|
@@ -400,6 +477,28 @@ public final AnalyzeSyntaxResponse analyzeSyntax(Document document, EncodingType
|
400 | 477 | return analyzeSyntax(request);
|
401 | 478 | }
|
402 | 479 |
|
| 480 | + // AUTO-GENERATED DOCUMENTATION AND METHOD |
| 481 | + /** |
| 482 | + * Analyzes the syntax of the text and provides sentence boundaries and tokenization along with |
| 483 | + * part-of-speech tags, dependency trees, and other properties. |
| 484 | + * |
| 485 | + * <p>Sample code: |
| 486 | + * |
| 487 | + * <pre><code> |
| 488 | + * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) { |
| 489 | + * Document document = Document.newBuilder().build(); |
| 490 | + * AnalyzeSyntaxResponse response = languageServiceClient.analyzeSyntax(document); |
| 491 | + * } |
| 492 | + * </code></pre> |
| 493 | + * |
| 494 | + * @param document Required. Input document. |
| 495 | + * @throws com.google.api.gax.rpc.ApiException if the remote call fails |
| 496 | + */ |
| 497 | + public final AnalyzeSyntaxResponse analyzeSyntax(Document document) { |
| 498 | + AnalyzeSyntaxRequest request = AnalyzeSyntaxRequest.newBuilder().setDocument(document).build(); |
| 499 | + return analyzeSyntax(request); |
| 500 | + } |
| 501 | + |
403 | 502 | // AUTO-GENERATED DOCUMENTATION AND METHOD
|
404 | 503 | /**
|
405 | 504 | * Analyzes the syntax of the text and provides sentence boundaries and tokenization along with
|
@@ -545,6 +644,32 @@ public final AnnotateTextResponse annotateText(
|
545 | 644 | return annotateText(request);
|
546 | 645 | }
|
547 | 646 |
|
| 647 | + // AUTO-GENERATED DOCUMENTATION AND METHOD |
| 648 | + /** |
| 649 | + * A convenience method that provides all syntax, sentiment, entity, and classification features |
| 650 | + * in one call. |
| 651 | + * |
| 652 | + * <p>Sample code: |
| 653 | + * |
| 654 | + * <pre><code> |
| 655 | + * try (LanguageServiceClient languageServiceClient = LanguageServiceClient.create()) { |
| 656 | + * Document document = Document.newBuilder().build(); |
| 657 | + * AnnotateTextRequest.Features features = AnnotateTextRequest.Features.newBuilder().build(); |
| 658 | + * AnnotateTextResponse response = languageServiceClient.annotateText(document, features); |
| 659 | + * } |
| 660 | + * </code></pre> |
| 661 | + * |
| 662 | + * @param document Required. Input document. |
| 663 | + * @param features Required. The enabled features. |
| 664 | + * @throws com.google.api.gax.rpc.ApiException if the remote call fails |
| 665 | + */ |
| 666 | + public final AnnotateTextResponse annotateText( |
| 667 | + Document document, AnnotateTextRequest.Features features) { |
| 668 | + AnnotateTextRequest request = |
| 669 | + AnnotateTextRequest.newBuilder().setDocument(document).setFeatures(features).build(); |
| 670 | + return annotateText(request); |
| 671 | + } |
| 672 | + |
548 | 673 | // AUTO-GENERATED DOCUMENTATION AND METHOD
|
549 | 674 | /**
|
550 | 675 | * A convenience method that provides all syntax, sentiment, entity, and classification features
|
|
0 commit comments