OLD | NEW |
1 // This is a generated file (see the discoveryapis_generator project). | 1 // This is a generated file (see the discoveryapis_generator project). |
2 | 2 |
3 library googleapis_beta.language.v1beta1; | 3 library googleapis_beta.language.v1beta1; |
4 | 4 |
5 import 'dart:core' as core; | 5 import 'dart:core' as core; |
6 import 'dart:async' as async; | 6 import 'dart:async' as async; |
7 import 'dart:convert' as convert; | 7 import 'dart:convert' as convert; |
8 | 8 |
9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; | 9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; |
10 import 'package:http/http.dart' as http; | 10 import 'package:http/http.dart' as http; |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 "POST", | 112 "POST", |
113 body: _body, | 113 body: _body, |
114 queryParams: _queryParams, | 114 queryParams: _queryParams, |
115 uploadOptions: _uploadOptions, | 115 uploadOptions: _uploadOptions, |
116 uploadMedia: _uploadMedia, | 116 uploadMedia: _uploadMedia, |
117 downloadOptions: _downloadOptions); | 117 downloadOptions: _downloadOptions); |
118 return _response.then((data) => new AnalyzeSentimentResponse.fromJson(data))
; | 118 return _response.then((data) => new AnalyzeSentimentResponse.fromJson(data))
; |
119 } | 119 } |
120 | 120 |
121 /** | 121 /** |
| 122 * Analyzes the syntax of the text and provides sentence boundaries and |
| 123 * tokenization along with part of speech tags, dependency trees, and other |
| 124 * properties. |
| 125 * |
| 126 * [request] - The metadata request object. |
| 127 * |
| 128 * Request parameters: |
| 129 * |
| 130 * Completes with a [AnalyzeSyntaxResponse]. |
| 131 * |
| 132 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 133 * error. |
| 134 * |
| 135 * If the used [http.Client] completes with an error when making a REST call, |
| 136 * this method will complete with the same error. |
| 137 */ |
| 138 async.Future<AnalyzeSyntaxResponse> analyzeSyntax(AnalyzeSyntaxRequest request
) { |
| 139 var _url = null; |
| 140 var _queryParams = new core.Map(); |
| 141 var _uploadMedia = null; |
| 142 var _uploadOptions = null; |
| 143 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 144 var _body = null; |
| 145 |
| 146 if (request != null) { |
| 147 _body = convert.JSON.encode((request).toJson()); |
| 148 } |
| 149 |
| 150 _url = 'v1beta1/documents:analyzeSyntax'; |
| 151 |
| 152 var _response = _requester.request(_url, |
| 153 "POST", |
| 154 body: _body, |
| 155 queryParams: _queryParams, |
| 156 uploadOptions: _uploadOptions, |
| 157 uploadMedia: _uploadMedia, |
| 158 downloadOptions: _downloadOptions); |
| 159 return _response.then((data) => new AnalyzeSyntaxResponse.fromJson(data)); |
| 160 } |
| 161 |
| 162 /** |
122 * A convenience method that provides all the features that analyzeSentiment, | 163 * A convenience method that provides all the features that analyzeSentiment, |
123 * analyzeEntities, and analyzeSyntax provide in one call. | 164 * analyzeEntities, and analyzeSyntax provide in one call. |
124 * | 165 * |
125 * [request] - The metadata request object. | 166 * [request] - The metadata request object. |
126 * | 167 * |
127 * Request parameters: | 168 * Request parameters: |
128 * | 169 * |
129 * Completes with a [AnnotateTextResponse]. | 170 * Completes with a [AnnotateTextResponse]. |
130 * | 171 * |
131 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 172 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 } | 285 } |
245 } | 286 } |
246 | 287 |
247 /** The sentiment analysis request message. */ | 288 /** The sentiment analysis request message. */ |
248 class AnalyzeSentimentRequest { | 289 class AnalyzeSentimentRequest { |
249 /** | 290 /** |
250 * Input document. Currently, `analyzeSentiment` only supports English text | 291 * Input document. Currently, `analyzeSentiment` only supports English text |
251 * (Document.language="EN"). | 292 * (Document.language="EN"). |
252 */ | 293 */ |
253 Document document; | 294 Document document; |
| 295 /** |
| 296 * The encoding type used by the API to calculate sentence offsets for the |
| 297 * sentence sentiment. |
| 298 * Possible string values are: |
| 299 * - "NONE" : If `EncodingType` is not specified, encoding-dependent |
| 300 * information (such as |
| 301 * `begin_offset`) will be set at `-1`. |
| 302 * - "UTF8" : Encoding-dependent information (such as `begin_offset`) is |
| 303 * calculated based |
| 304 * on the UTF-8 encoding of the input. C++ and Go are examples of languages |
| 305 * that use this encoding natively. |
| 306 * - "UTF16" : Encoding-dependent information (such as `begin_offset`) is |
| 307 * calculated based |
| 308 * on the UTF-16 encoding of the input. Java and Javascript are examples of |
| 309 * languages that use this encoding natively. |
| 310 * - "UTF32" : Encoding-dependent information (such as `begin_offset`) is |
| 311 * calculated based |
| 312 * on the UTF-32 encoding of the input. Python is an example of a language |
| 313 * that uses this encoding natively. |
| 314 */ |
| 315 core.String encodingType; |
254 | 316 |
255 AnalyzeSentimentRequest(); | 317 AnalyzeSentimentRequest(); |
256 | 318 |
257 AnalyzeSentimentRequest.fromJson(core.Map _json) { | 319 AnalyzeSentimentRequest.fromJson(core.Map _json) { |
258 if (_json.containsKey("document")) { | 320 if (_json.containsKey("document")) { |
259 document = new Document.fromJson(_json["document"]); | 321 document = new Document.fromJson(_json["document"]); |
260 } | 322 } |
| 323 if (_json.containsKey("encodingType")) { |
| 324 encodingType = _json["encodingType"]; |
| 325 } |
261 } | 326 } |
262 | 327 |
263 core.Map toJson() { | 328 core.Map toJson() { |
264 var _json = new core.Map(); | 329 var _json = new core.Map(); |
265 if (document != null) { | 330 if (document != null) { |
266 _json["document"] = (document).toJson(); | 331 _json["document"] = (document).toJson(); |
267 } | 332 } |
| 333 if (encodingType != null) { |
| 334 _json["encodingType"] = encodingType; |
| 335 } |
268 return _json; | 336 return _json; |
269 } | 337 } |
270 } | 338 } |
271 | 339 |
272 /** The sentiment analysis response message. */ | 340 /** The sentiment analysis response message. */ |
273 class AnalyzeSentimentResponse { | 341 class AnalyzeSentimentResponse { |
274 /** The overall sentiment of the input document. */ | 342 /** The overall sentiment of the input document. */ |
275 Sentiment documentSentiment; | 343 Sentiment documentSentiment; |
276 /** | 344 /** |
277 * The language of the text, which will be the same as the language specified | 345 * The language of the text, which will be the same as the language specified |
278 * in the request or, if not specified, the automatically-detected language. | 346 * in the request or, if not specified, the automatically-detected language. |
279 */ | 347 */ |
280 core.String language; | 348 core.String language; |
| 349 /** The sentiment for all the sentences in the document. */ |
| 350 core.List<Sentence> sentences; |
281 | 351 |
282 AnalyzeSentimentResponse(); | 352 AnalyzeSentimentResponse(); |
283 | 353 |
284 AnalyzeSentimentResponse.fromJson(core.Map _json) { | 354 AnalyzeSentimentResponse.fromJson(core.Map _json) { |
285 if (_json.containsKey("documentSentiment")) { | 355 if (_json.containsKey("documentSentiment")) { |
286 documentSentiment = new Sentiment.fromJson(_json["documentSentiment"]); | 356 documentSentiment = new Sentiment.fromJson(_json["documentSentiment"]); |
287 } | 357 } |
288 if (_json.containsKey("language")) { | 358 if (_json.containsKey("language")) { |
289 language = _json["language"]; | 359 language = _json["language"]; |
290 } | 360 } |
| 361 if (_json.containsKey("sentences")) { |
| 362 sentences = _json["sentences"].map((value) => new Sentence.fromJson(value)
).toList(); |
| 363 } |
291 } | 364 } |
292 | 365 |
293 core.Map toJson() { | 366 core.Map toJson() { |
294 var _json = new core.Map(); | 367 var _json = new core.Map(); |
295 if (documentSentiment != null) { | 368 if (documentSentiment != null) { |
296 _json["documentSentiment"] = (documentSentiment).toJson(); | 369 _json["documentSentiment"] = (documentSentiment).toJson(); |
297 } | 370 } |
298 if (language != null) { | 371 if (language != null) { |
299 _json["language"] = language; | 372 _json["language"] = language; |
300 } | 373 } |
| 374 if (sentences != null) { |
| 375 _json["sentences"] = sentences.map((value) => (value).toJson()).toList(); |
| 376 } |
301 return _json; | 377 return _json; |
302 } | 378 } |
303 } | 379 } |
| 380 |
| 381 /** The syntax analysis request message. */ |
| 382 class AnalyzeSyntaxRequest { |
| 383 /** Input document. */ |
| 384 Document document; |
| 385 /** |
| 386 * The encoding type used by the API to calculate offsets. |
| 387 * Possible string values are: |
| 388 * - "NONE" : If `EncodingType` is not specified, encoding-dependent |
| 389 * information (such as |
| 390 * `begin_offset`) will be set at `-1`. |
| 391 * - "UTF8" : Encoding-dependent information (such as `begin_offset`) is |
| 392 * calculated based |
| 393 * on the UTF-8 encoding of the input. C++ and Go are examples of languages |
| 394 * that use this encoding natively. |
| 395 * - "UTF16" : Encoding-dependent information (such as `begin_offset`) is |
| 396 * calculated based |
| 397 * on the UTF-16 encoding of the input. Java and Javascript are examples of |
| 398 * languages that use this encoding natively. |
| 399 * - "UTF32" : Encoding-dependent information (such as `begin_offset`) is |
| 400 * calculated based |
| 401 * on the UTF-32 encoding of the input. Python is an example of a language |
| 402 * that uses this encoding natively. |
| 403 */ |
| 404 core.String encodingType; |
| 405 |
| 406 AnalyzeSyntaxRequest(); |
| 407 |
| 408 AnalyzeSyntaxRequest.fromJson(core.Map _json) { |
| 409 if (_json.containsKey("document")) { |
| 410 document = new Document.fromJson(_json["document"]); |
| 411 } |
| 412 if (_json.containsKey("encodingType")) { |
| 413 encodingType = _json["encodingType"]; |
| 414 } |
| 415 } |
| 416 |
| 417 core.Map toJson() { |
| 418 var _json = new core.Map(); |
| 419 if (document != null) { |
| 420 _json["document"] = (document).toJson(); |
| 421 } |
| 422 if (encodingType != null) { |
| 423 _json["encodingType"] = encodingType; |
| 424 } |
| 425 return _json; |
| 426 } |
| 427 } |
| 428 |
| 429 /** The syntax analysis response message. */ |
| 430 class AnalyzeSyntaxResponse { |
| 431 /** |
| 432 * The language of the text, which will be the same as the language specified |
| 433 * in the request or, if not specified, the automatically-detected language. |
| 434 * See Document.language field for more details. |
| 435 */ |
| 436 core.String language; |
| 437 /** Sentences in the input document. */ |
| 438 core.List<Sentence> sentences; |
| 439 /** Tokens, along with their syntactic information, in the input document. */ |
| 440 core.List<Token> tokens; |
| 441 |
| 442 AnalyzeSyntaxResponse(); |
| 443 |
| 444 AnalyzeSyntaxResponse.fromJson(core.Map _json) { |
| 445 if (_json.containsKey("language")) { |
| 446 language = _json["language"]; |
| 447 } |
| 448 if (_json.containsKey("sentences")) { |
| 449 sentences = _json["sentences"].map((value) => new Sentence.fromJson(value)
).toList(); |
| 450 } |
| 451 if (_json.containsKey("tokens")) { |
| 452 tokens = _json["tokens"].map((value) => new Token.fromJson(value)).toList(
); |
| 453 } |
| 454 } |
| 455 |
| 456 core.Map toJson() { |
| 457 var _json = new core.Map(); |
| 458 if (language != null) { |
| 459 _json["language"] = language; |
| 460 } |
| 461 if (sentences != null) { |
| 462 _json["sentences"] = sentences.map((value) => (value).toJson()).toList(); |
| 463 } |
| 464 if (tokens != null) { |
| 465 _json["tokens"] = tokens.map((value) => (value).toJson()).toList(); |
| 466 } |
| 467 return _json; |
| 468 } |
| 469 } |
304 | 470 |
305 /** | 471 /** |
306 * The request message for the text annotation API, which can perform multiple | 472 * The request message for the text annotation API, which can perform multiple |
307 * analysis types (sentiment, entities, and syntax) in one call. | 473 * analysis types (sentiment, entities, and syntax) in one call. |
308 */ | 474 */ |
309 class AnnotateTextRequest { | 475 class AnnotateTextRequest { |
310 /** Input document. */ | 476 /** Input document. */ |
311 Document document; | 477 Document document; |
312 /** | 478 /** |
313 * The encoding type used by the API to calculate offsets. | 479 * The encoding type used by the API to calculate offsets. |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 } | 717 } |
552 | 718 |
553 /** | 719 /** |
554 * ################################################################ # | 720 * ################################################################ # |
555 * | 721 * |
556 * Represents the input to API methods. | 722 * Represents the input to API methods. |
557 */ | 723 */ |
558 class Document { | 724 class Document { |
559 /** The content of the input in string format. */ | 725 /** The content of the input in string format. */ |
560 core.String content; | 726 core.String content; |
561 /** The Google Cloud Storage URI where the file content is located. */ | 727 /** |
| 728 * The Google Cloud Storage URI where the file content is located. |
| 729 * This URI must be of the form: gs://bucket_name/object_name. For more |
| 730 * details, see https://cloud.google.com/storage/docs/reference-uris. |
| 731 * NOTE: Cloud Storage object versioning is not supported. |
| 732 */ |
562 core.String gcsContentUri; | 733 core.String gcsContentUri; |
563 /** | 734 /** |
564 * The language of the document (if not specified, the language is | 735 * The language of the document (if not specified, the language is |
565 * automatically detected). Both ISO and BCP-47 language codes are | 736 * automatically detected). Both ISO and BCP-47 language codes are |
566 * accepted.<br> | 737 * accepted.<br> |
567 * **Current Language Restrictions:** | 738 * **Current Language Restrictions:** |
568 * | 739 * |
569 * * Only English, Spanish, and Japanese textual content | 740 * * Only English, Spanish, and Japanese textual content are supported. |
570 * are supported, with the following additional restriction: | |
571 * * `analyzeSentiment` only supports English text. | |
572 * If the language (either specified by the caller or automatically detected) | 741 * If the language (either specified by the caller or automatically detected) |
573 * is not supported by the called API method, an `INVALID_ARGUMENT` error | 742 * is not supported by the called API method, an `INVALID_ARGUMENT` error |
574 * is returned. | 743 * is returned. |
575 */ | 744 */ |
576 core.String language; | 745 core.String language; |
577 /** | 746 /** |
578 * Required. If the type is not set or is `TYPE_UNSPECIFIED`, | 747 * Required. If the type is not set or is `TYPE_UNSPECIFIED`, |
579 * returns an `INVALID_ARGUMENT` error. | 748 * returns an `INVALID_ARGUMENT` error. |
580 * Possible string values are: | 749 * Possible string values are: |
581 * - "TYPE_UNSPECIFIED" : The content type is not specified. | 750 * - "TYPE_UNSPECIFIED" : The content type is not specified. |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
626 */ | 795 */ |
627 class Entity { | 796 class Entity { |
628 /** | 797 /** |
629 * The mentions of this entity in the input document. The API currently | 798 * The mentions of this entity in the input document. The API currently |
630 * supports proper noun mentions. | 799 * supports proper noun mentions. |
631 */ | 800 */ |
632 core.List<EntityMention> mentions; | 801 core.List<EntityMention> mentions; |
633 /** | 802 /** |
634 * Metadata associated with the entity. | 803 * Metadata associated with the entity. |
635 * | 804 * |
636 * Currently, only Wikipedia URLs are provided, if available. | 805 * Currently, Wikipedia URLs and Knowledge Graph MIDs are provided, if |
637 * The associated key is "wikipedia_url". | 806 * available. The associated keys are "wikipedia_url" and "mid", respectively. |
638 */ | 807 */ |
639 core.Map<core.String, core.String> metadata; | 808 core.Map<core.String, core.String> metadata; |
640 /** The representative name for the entity. */ | 809 /** The representative name for the entity. */ |
641 core.String name; | 810 core.String name; |
642 /** | 811 /** |
643 * The salience score associated with the entity in the [0, 1.0] range. | 812 * The salience score associated with the entity in the [0, 1.0] range. |
644 * | 813 * |
645 * The salience score for an entity provides information about the | 814 * The salience score for an entity provides information about the |
646 * importance or centrality of that entity to the entire document text. | 815 * importance or centrality of that entity to the entire document text. |
647 * Scores closer to 0 are less salient, while scores closer to 1.0 are highly | 816 * Scores closer to 0 are less salient, while scores closer to 1.0 are highly |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
703 } | 872 } |
704 } | 873 } |
705 | 874 |
706 /** | 875 /** |
707 * Represents a mention for an entity in the text. Currently, proper noun | 876 * Represents a mention for an entity in the text. Currently, proper noun |
708 * mentions are supported. | 877 * mentions are supported. |
709 */ | 878 */ |
710 class EntityMention { | 879 class EntityMention { |
711 /** The mention text. */ | 880 /** The mention text. */ |
712 TextSpan text; | 881 TextSpan text; |
| 882 /** |
| 883 * The type of the entity mention. |
| 884 * Possible string values are: |
| 885 * - "TYPE_UNKNOWN" : Unknown |
| 886 * - "PROPER" : Proper name |
| 887 * - "COMMON" : Common noun (or noun compound) |
| 888 */ |
| 889 core.String type; |
713 | 890 |
714 EntityMention(); | 891 EntityMention(); |
715 | 892 |
716 EntityMention.fromJson(core.Map _json) { | 893 EntityMention.fromJson(core.Map _json) { |
717 if (_json.containsKey("text")) { | 894 if (_json.containsKey("text")) { |
718 text = new TextSpan.fromJson(_json["text"]); | 895 text = new TextSpan.fromJson(_json["text"]); |
719 } | 896 } |
| 897 if (_json.containsKey("type")) { |
| 898 type = _json["type"]; |
| 899 } |
720 } | 900 } |
721 | 901 |
722 core.Map toJson() { | 902 core.Map toJson() { |
723 var _json = new core.Map(); | 903 var _json = new core.Map(); |
724 if (text != null) { | 904 if (text != null) { |
725 _json["text"] = (text).toJson(); | 905 _json["text"] = (text).toJson(); |
726 } | 906 } |
| 907 if (type != null) { |
| 908 _json["type"] = type; |
| 909 } |
727 return _json; | 910 return _json; |
728 } | 911 } |
729 } | 912 } |
730 | 913 |
731 /** | 914 /** |
732 * All available features for sentiment, syntax, and semantic analysis. | 915 * All available features for sentiment, syntax, and semantic analysis. |
733 * Setting each one to true will enable that specific analysis for the input. | 916 * Setting each one to true will enable that specific analysis for the input. |
734 */ | 917 */ |
735 class Features { | 918 class Features { |
736 /** Extract document-level sentiment. */ | 919 /** Extract document-level sentiment. */ |
(...skipping 28 matching lines...) Expand all Loading... |
765 if (extractSyntax != null) { | 948 if (extractSyntax != null) { |
766 _json["extractSyntax"] = extractSyntax; | 949 _json["extractSyntax"] = extractSyntax; |
767 } | 950 } |
768 return _json; | 951 return _json; |
769 } | 952 } |
770 } | 953 } |
771 | 954 |
772 /** Represents part of speech information for a token. */ | 955 /** Represents part of speech information for a token. */ |
773 class PartOfSpeech { | 956 class PartOfSpeech { |
774 /** | 957 /** |
| 958 * The grammatical aspect. |
| 959 * Possible string values are: |
| 960 * - "ASPECT_UNKNOWN" : Aspect is not applicable in the analyzed language or |
| 961 * is not predicted. |
| 962 * - "PERFECTIVE" : Perfective |
| 963 * - "IMPERFECTIVE" : Imperfective |
| 964 * - "PROGRESSIVE" : Progressive |
| 965 */ |
| 966 core.String aspect; |
| 967 /** |
| 968 * The grammatical case. |
| 969 * Possible string values are: |
| 970 * - "CASE_UNKNOWN" : Case is not applicable in the analyzed language or is |
| 971 * not predicted. |
| 972 * - "ACCUSATIVE" : Accusative |
| 973 * - "ADVERBIAL" : Adverbial |
| 974 * - "COMPLEMENTIVE" : Complementive |
| 975 * - "DATIVE" : Dative |
| 976 * - "GENITIVE" : Genitive |
| 977 * - "INSTRUMENTAL" : Instrumental |
| 978 * - "LOCATIVE" : Locative |
| 979 * - "NOMINATIVE" : Nominative |
| 980 * - "OBLIQUE" : Oblique |
| 981 * - "PARTITIVE" : Partitive |
| 982 * - "PREPOSITIONAL" : Prepositional |
| 983 * - "REFLEXIVE_CASE" : Reflexive |
| 984 * - "RELATIVE_CASE" : Relative |
| 985 * - "VOCATIVE" : Vocative |
| 986 */ |
| 987 core.String case_; |
| 988 /** |
| 989 * The grammatical form. |
| 990 * Possible string values are: |
| 991 * - "FORM_UNKNOWN" : Form is not applicable in the analyzed language or is |
| 992 * not predicted. |
| 993 * - "ADNOMIAL" : Adnomial |
| 994 * - "AUXILIARY" : Auxiliary |
| 995 * - "COMPLEMENTIZER" : Complementizer |
| 996 * - "FINAL_ENDING" : Final ending |
| 997 * - "GERUND" : Gerund |
| 998 * - "REALIS" : Realis |
| 999 * - "IRREALIS" : Irrealis |
| 1000 * - "SHORT" : Short form |
| 1001 * - "LONG" : Long form |
| 1002 * - "ORDER" : Order form |
| 1003 * - "SPECIFIC" : Specific form |
| 1004 */ |
| 1005 core.String form; |
| 1006 /** |
| 1007 * The grammatical gender. |
| 1008 * Possible string values are: |
| 1009 * - "GENDER_UNKNOWN" : Gender is not applicable in the analyzed language or |
| 1010 * is not predicted. |
| 1011 * - "FEMININE" : Feminine |
| 1012 * - "MASCULINE" : Masculine |
| 1013 * - "NEUTER" : Neuter |
| 1014 */ |
| 1015 core.String gender; |
| 1016 /** |
| 1017 * The grammatical mood. |
| 1018 * Possible string values are: |
| 1019 * - "MOOD_UNKNOWN" : Mood is not applicable in the analyzed language or is |
| 1020 * not predicted. |
| 1021 * - "CONDITIONAL_MOOD" : Conditional |
| 1022 * - "IMPERATIVE" : Imperative |
| 1023 * - "INDICATIVE" : Indicative |
| 1024 * - "INTERROGATIVE" : Interrogative |
| 1025 * - "JUSSIVE" : Jussive |
| 1026 * - "SUBJUNCTIVE" : Subjunctive |
| 1027 */ |
| 1028 core.String mood; |
| 1029 /** |
| 1030 * The grammatical number. |
| 1031 * Possible string values are: |
| 1032 * - "NUMBER_UNKNOWN" : Number is not applicable in the analyzed language or |
| 1033 * is not predicted. |
| 1034 * - "SINGULAR" : Singular |
| 1035 * - "PLURAL" : Plural |
| 1036 * - "DUAL" : Dual |
| 1037 */ |
| 1038 core.String number; |
| 1039 /** |
| 1040 * The grammatical person. |
| 1041 * Possible string values are: |
| 1042 * - "PERSON_UNKNOWN" : Person is not applicable in the analyzed language or |
| 1043 * is not predicted. |
| 1044 * - "FIRST" : First |
| 1045 * - "SECOND" : Second |
| 1046 * - "THIRD" : Third |
| 1047 * - "REFLEXIVE_PERSON" : Reflexive |
| 1048 */ |
| 1049 core.String person; |
| 1050 /** |
| 1051 * The grammatical properness. |
| 1052 * Possible string values are: |
| 1053 * - "PROPER_UNKNOWN" : Proper is not applicable in the analyzed language or |
| 1054 * is not predicted. |
| 1055 * - "PROPER" : Proper |
| 1056 * - "NOT_PROPER" : Not proper |
| 1057 */ |
| 1058 core.String proper; |
| 1059 /** |
| 1060 * The grammatical reciprocity. |
| 1061 * Possible string values are: |
| 1062 * - "RECIPROCITY_UNKNOWN" : Reciprocity is not applicable in the analyzed |
| 1063 * language or is not |
| 1064 * predicted. |
| 1065 * - "RECIPROCAL" : Reciprocal |
| 1066 * - "NON_RECIPROCAL" : Non-reciprocal |
| 1067 */ |
| 1068 core.String reciprocity; |
| 1069 /** |
775 * The part of speech tag. | 1070 * The part of speech tag. |
776 * Possible string values are: | 1071 * Possible string values are: |
777 * - "UNKNOWN" : Unknown | 1072 * - "UNKNOWN" : Unknown |
778 * - "ADJ" : Adjective | 1073 * - "ADJ" : Adjective |
779 * - "ADP" : Adposition (preposition and postposition) | 1074 * - "ADP" : Adposition (preposition and postposition) |
780 * - "ADV" : Adverb | 1075 * - "ADV" : Adverb |
781 * - "CONJ" : Conjunction | 1076 * - "CONJ" : Conjunction |
782 * - "DET" : Determiner | 1077 * - "DET" : Determiner |
783 * - "NOUN" : Noun (common and proper) | 1078 * - "NOUN" : Noun (common and proper) |
784 * - "NUM" : Cardinal number | 1079 * - "NUM" : Cardinal number |
785 * - "PRON" : Pronoun | 1080 * - "PRON" : Pronoun |
786 * - "PRT" : Particle or other function word | 1081 * - "PRT" : Particle or other function word |
787 * - "PUNCT" : Punctuation | 1082 * - "PUNCT" : Punctuation |
788 * - "VERB" : Verb (all tenses and modes) | 1083 * - "VERB" : Verb (all tenses and modes) |
789 * - "X" : Other: foreign words, typos, abbreviations | 1084 * - "X" : Other: foreign words, typos, abbreviations |
790 * - "AFFIX" : Affix | 1085 * - "AFFIX" : Affix |
791 */ | 1086 */ |
792 core.String tag; | 1087 core.String tag; |
| 1088 /** |
| 1089 * The grammatical tense. |
| 1090 * Possible string values are: |
| 1091 * - "TENSE_UNKNOWN" : Tense is not applicable in the analyzed language or is |
| 1092 * not predicted. |
| 1093 * - "CONDITIONAL_TENSE" : Conditional |
| 1094 * - "FUTURE" : Future |
| 1095 * - "PAST" : Past |
| 1096 * - "PRESENT" : Present |
| 1097 * - "IMPERFECT" : Imperfect |
| 1098 * - "PLUPERFECT" : Pluperfect |
| 1099 */ |
| 1100 core.String tense; |
| 1101 /** |
| 1102 * The grammatical voice. |
| 1103 * Possible string values are: |
| 1104 * - "VOICE_UNKNOWN" : Voice is not applicable in the analyzed language or is |
| 1105 * not predicted. |
| 1106 * - "ACTIVE" : Active |
| 1107 * - "CAUSATIVE" : Causative |
| 1108 * - "PASSIVE" : Passive |
| 1109 */ |
| 1110 core.String voice; |
793 | 1111 |
794 PartOfSpeech(); | 1112 PartOfSpeech(); |
795 | 1113 |
796 PartOfSpeech.fromJson(core.Map _json) { | 1114 PartOfSpeech.fromJson(core.Map _json) { |
| 1115 if (_json.containsKey("aspect")) { |
| 1116 aspect = _json["aspect"]; |
| 1117 } |
| 1118 if (_json.containsKey("case")) { |
| 1119 case_ = _json["case"]; |
| 1120 } |
| 1121 if (_json.containsKey("form")) { |
| 1122 form = _json["form"]; |
| 1123 } |
| 1124 if (_json.containsKey("gender")) { |
| 1125 gender = _json["gender"]; |
| 1126 } |
| 1127 if (_json.containsKey("mood")) { |
| 1128 mood = _json["mood"]; |
| 1129 } |
| 1130 if (_json.containsKey("number")) { |
| 1131 number = _json["number"]; |
| 1132 } |
| 1133 if (_json.containsKey("person")) { |
| 1134 person = _json["person"]; |
| 1135 } |
| 1136 if (_json.containsKey("proper")) { |
| 1137 proper = _json["proper"]; |
| 1138 } |
| 1139 if (_json.containsKey("reciprocity")) { |
| 1140 reciprocity = _json["reciprocity"]; |
| 1141 } |
797 if (_json.containsKey("tag")) { | 1142 if (_json.containsKey("tag")) { |
798 tag = _json["tag"]; | 1143 tag = _json["tag"]; |
799 } | 1144 } |
| 1145 if (_json.containsKey("tense")) { |
| 1146 tense = _json["tense"]; |
| 1147 } |
| 1148 if (_json.containsKey("voice")) { |
| 1149 voice = _json["voice"]; |
| 1150 } |
800 } | 1151 } |
801 | 1152 |
802 core.Map toJson() { | 1153 core.Map toJson() { |
803 var _json = new core.Map(); | 1154 var _json = new core.Map(); |
| 1155 if (aspect != null) { |
| 1156 _json["aspect"] = aspect; |
| 1157 } |
| 1158 if (case_ != null) { |
| 1159 _json["case"] = case_; |
| 1160 } |
| 1161 if (form != null) { |
| 1162 _json["form"] = form; |
| 1163 } |
| 1164 if (gender != null) { |
| 1165 _json["gender"] = gender; |
| 1166 } |
| 1167 if (mood != null) { |
| 1168 _json["mood"] = mood; |
| 1169 } |
| 1170 if (number != null) { |
| 1171 _json["number"] = number; |
| 1172 } |
| 1173 if (person != null) { |
| 1174 _json["person"] = person; |
| 1175 } |
| 1176 if (proper != null) { |
| 1177 _json["proper"] = proper; |
| 1178 } |
| 1179 if (reciprocity != null) { |
| 1180 _json["reciprocity"] = reciprocity; |
| 1181 } |
804 if (tag != null) { | 1182 if (tag != null) { |
805 _json["tag"] = tag; | 1183 _json["tag"] = tag; |
806 } | 1184 } |
| 1185 if (tense != null) { |
| 1186 _json["tense"] = tense; |
| 1187 } |
| 1188 if (voice != null) { |
| 1189 _json["voice"] = voice; |
| 1190 } |
807 return _json; | 1191 return _json; |
808 } | 1192 } |
809 } | 1193 } |
810 | 1194 |
811 /** Represents a sentence in the input document. */ | 1195 /** Represents a sentence in the input document. */ |
812 class Sentence { | 1196 class Sentence { |
| 1197 /** |
| 1198 * For calls to AnalyzeSentiment or if |
| 1199 * AnnotateTextRequest.Features.extract_document_sentiment is set to |
| 1200 * true, this field will contain the sentiment for the sentence. |
| 1201 */ |
| 1202 Sentiment sentiment; |
813 /** The sentence text. */ | 1203 /** The sentence text. */ |
814 TextSpan text; | 1204 TextSpan text; |
815 | 1205 |
816 Sentence(); | 1206 Sentence(); |
817 | 1207 |
818 Sentence.fromJson(core.Map _json) { | 1208 Sentence.fromJson(core.Map _json) { |
| 1209 if (_json.containsKey("sentiment")) { |
| 1210 sentiment = new Sentiment.fromJson(_json["sentiment"]); |
| 1211 } |
819 if (_json.containsKey("text")) { | 1212 if (_json.containsKey("text")) { |
820 text = new TextSpan.fromJson(_json["text"]); | 1213 text = new TextSpan.fromJson(_json["text"]); |
821 } | 1214 } |
822 } | 1215 } |
823 | 1216 |
824 core.Map toJson() { | 1217 core.Map toJson() { |
825 var _json = new core.Map(); | 1218 var _json = new core.Map(); |
| 1219 if (sentiment != null) { |
| 1220 _json["sentiment"] = (sentiment).toJson(); |
| 1221 } |
826 if (text != null) { | 1222 if (text != null) { |
827 _json["text"] = (text).toJson(); | 1223 _json["text"] = (text).toJson(); |
828 } | 1224 } |
829 return _json; | 1225 return _json; |
830 } | 1226 } |
831 } | 1227 } |
832 | 1228 |
833 /** | 1229 /** |
834 * Represents the feeling associated with the entire text or entities in | 1230 * Represents the feeling associated with the entire text or entities in |
835 * the text. | 1231 * the text. |
836 */ | 1232 */ |
837 class Sentiment { | 1233 class Sentiment { |
838 /** | 1234 /** |
839 * A non-negative number in the [0, +inf) range, which represents | 1235 * A non-negative number in the [0, +inf) range, which represents |
840 * the absolute magnitude of sentiment regardless of polarity (positive or | 1236 * the absolute magnitude of sentiment regardless of score (positive or |
841 * negative). | 1237 * negative). |
842 */ | 1238 */ |
843 core.double magnitude; | 1239 core.double magnitude; |
844 /** | 1240 /** |
845 * DEPRECATED FIELD - This field is being deprecated in | 1241 * DEPRECATED FIELD - This field is being deprecated in |
846 * favor of score. Please refer to our documentation at | 1242 * favor of score. Please refer to our documentation at |
847 * https://cloud.google.com/natural-language/docs for more information. | 1243 * https://cloud.google.com/natural-language/docs for more information. |
848 */ | 1244 */ |
849 core.double polarity; | 1245 core.double polarity; |
| 1246 /** |
| 1247 * Sentiment score between -1.0 (negative sentiment) and 1.0 |
| 1248 * (positive sentiment). |
| 1249 */ |
| 1250 core.double score; |
850 | 1251 |
851 Sentiment(); | 1252 Sentiment(); |
852 | 1253 |
853 Sentiment.fromJson(core.Map _json) { | 1254 Sentiment.fromJson(core.Map _json) { |
854 if (_json.containsKey("magnitude")) { | 1255 if (_json.containsKey("magnitude")) { |
855 magnitude = _json["magnitude"]; | 1256 magnitude = _json["magnitude"]; |
856 } | 1257 } |
857 if (_json.containsKey("polarity")) { | 1258 if (_json.containsKey("polarity")) { |
858 polarity = _json["polarity"]; | 1259 polarity = _json["polarity"]; |
859 } | 1260 } |
| 1261 if (_json.containsKey("score")) { |
| 1262 score = _json["score"]; |
| 1263 } |
860 } | 1264 } |
861 | 1265 |
862 core.Map toJson() { | 1266 core.Map toJson() { |
863 var _json = new core.Map(); | 1267 var _json = new core.Map(); |
864 if (magnitude != null) { | 1268 if (magnitude != null) { |
865 _json["magnitude"] = magnitude; | 1269 _json["magnitude"] = magnitude; |
866 } | 1270 } |
867 if (polarity != null) { | 1271 if (polarity != null) { |
868 _json["polarity"] = polarity; | 1272 _json["polarity"] = polarity; |
869 } | 1273 } |
| 1274 if (score != null) { |
| 1275 _json["score"] = score; |
| 1276 } |
870 return _json; | 1277 return _json; |
871 } | 1278 } |
872 } | 1279 } |
873 | 1280 |
874 /** | 1281 /** |
875 * The `Status` type defines a logical error model that is suitable for | 1282 * The `Status` type defines a logical error model that is suitable for |
876 * different | 1283 * different |
877 * programming environments, including REST APIs and RPC APIs. It is used by | 1284 * programming environments, including REST APIs and RPC APIs. It is used by |
878 * [gRPC](https://github.com/grpc). The error model is designed to be: | 1285 * [gRPC](https://github.com/grpc). The error model is designed to be: |
879 * | 1286 * |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1005 } | 1412 } |
1006 return _json; | 1413 return _json; |
1007 } | 1414 } |
1008 } | 1415 } |
1009 | 1416 |
1010 /** Represents the smallest syntactic building block of the text. */ | 1417 /** Represents the smallest syntactic building block of the text. */ |
1011 class Token { | 1418 class Token { |
1012 /** Dependency tree parse for this token. */ | 1419 /** Dependency tree parse for this token. */ |
1013 DependencyEdge dependencyEdge; | 1420 DependencyEdge dependencyEdge; |
1014 /** | 1421 /** |
1015 * [Lemma](https://en.wikipedia.org/wiki/Lemma_(morphology)) | 1422 * [Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the token. |
1016 * of the token. | |
1017 */ | 1423 */ |
1018 core.String lemma; | 1424 core.String lemma; |
1019 /** Parts of speech tag for this token. */ | 1425 /** Parts of speech tag for this token. */ |
1020 PartOfSpeech partOfSpeech; | 1426 PartOfSpeech partOfSpeech; |
1021 /** The token text. */ | 1427 /** The token text. */ |
1022 TextSpan text; | 1428 TextSpan text; |
1023 | 1429 |
1024 Token(); | 1430 Token(); |
1025 | 1431 |
1026 Token.fromJson(core.Map _json) { | 1432 Token.fromJson(core.Map _json) { |
(...skipping 21 matching lines...) Expand all Loading... |
1048 } | 1454 } |
1049 if (partOfSpeech != null) { | 1455 if (partOfSpeech != null) { |
1050 _json["partOfSpeech"] = (partOfSpeech).toJson(); | 1456 _json["partOfSpeech"] = (partOfSpeech).toJson(); |
1051 } | 1457 } |
1052 if (text != null) { | 1458 if (text != null) { |
1053 _json["text"] = (text).toJson(); | 1459 _json["text"] = (text).toJson(); |
1054 } | 1460 } |
1055 return _json; | 1461 return _json; |
1056 } | 1462 } |
1057 } | 1463 } |
OLD | NEW |