| 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.v1beta2; | 3 library googleapis_beta.language.v1beta2; |
| 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; |
| 11 | 11 |
| 12 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' show | 12 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' |
| 13 ApiRequestError, DetailedApiRequestError; | 13 show ApiRequestError, DetailedApiRequestError; |
| 14 | 14 |
| 15 const core.String USER_AGENT = 'dart-api-client language/v1beta2'; | 15 const core.String USER_AGENT = 'dart-api-client language/v1beta2'; |
| 16 | 16 |
| 17 /** | 17 /// Provides natural language understanding technologies to developers. |
| 18 * Provides natural language understanding technologies to developers. Examples | 18 /// Examples include sentiment analysis, entity recognition, entity sentiment |
| 19 * include sentiment analysis, entity recognition, entity sentiment analysis, | 19 /// analysis, and text annotations. |
| 20 * and text annotations. | |
| 21 */ | |
| 22 class LanguageApi { | 20 class LanguageApi { |
| 23 /** | 21 /// Apply machine learning models to reveal the structure and meaning of text |
| 24 * Apply machine learning models to reveal the structure and meaning of text | 22 static const CloudLanguageScope = |
| 25 */ | 23 "https://www.googleapis.com/auth/cloud-language"; |
| 26 static const CloudLanguageScope = "https://www.googleapis.com/auth/cloud-langu
age"; | |
| 27 | 24 |
| 28 /** View and manage your data across Google Cloud Platform services */ | 25 /// View and manage your data across Google Cloud Platform services |
| 29 static const CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platf
orm"; | 26 static const CloudPlatformScope = |
| 30 | 27 "https://www.googleapis.com/auth/cloud-platform"; |
| 31 | 28 |
| 32 final commons.ApiRequester _requester; | 29 final commons.ApiRequester _requester; |
| 33 | 30 |
| 34 DocumentsResourceApi get documents => new DocumentsResourceApi(_requester); | 31 DocumentsResourceApi get documents => new DocumentsResourceApi(_requester); |
| 35 | 32 |
| 36 LanguageApi(http.Client client, {core.String rootUrl: "https://language.google
apis.com/", core.String servicePath: ""}) : | 33 LanguageApi(http.Client client, |
| 37 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A
GENT); | 34 {core.String rootUrl: "https://language.googleapis.com/", |
| 35 core.String servicePath: ""}) |
| 36 : _requester = |
| 37 new commons.ApiRequester(client, rootUrl, servicePath, USER_AGENT); |
| 38 } | 38 } |
| 39 | 39 |
| 40 | |
| 41 class DocumentsResourceApi { | 40 class DocumentsResourceApi { |
| 42 final commons.ApiRequester _requester; | 41 final commons.ApiRequester _requester; |
| 43 | 42 |
| 44 DocumentsResourceApi(commons.ApiRequester client) : | 43 DocumentsResourceApi(commons.ApiRequester client) : _requester = client; |
| 45 _requester = client; | |
| 46 | 44 |
| 47 /** | 45 /// Finds named entities (currently proper names and common nouns) in the |
| 48 * Finds named entities (currently proper names and common nouns) in the text | 46 /// text |
| 49 * along with entity types, salience, mentions for each entity, and | 47 /// along with entity types, salience, mentions for each entity, and |
| 50 * other properties. | 48 /// other properties. |
| 51 * | 49 /// |
| 52 * [request] - The metadata request object. | 50 /// [request] - The metadata request object. |
| 53 * | 51 /// |
| 54 * Request parameters: | 52 /// Request parameters: |
| 55 * | 53 /// |
| 56 * Completes with a [AnalyzeEntitiesResponse]. | 54 /// Completes with a [AnalyzeEntitiesResponse]. |
| 57 * | 55 /// |
| 58 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 56 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 59 * error. | 57 /// an error. |
| 60 * | 58 /// |
| 61 * If the used [http.Client] completes with an error when making a REST call, | 59 /// If the used [http.Client] completes with an error when making a REST |
| 62 * this method will complete with the same error. | 60 /// call, this method will complete with the same error. |
| 63 */ | 61 async.Future<AnalyzeEntitiesResponse> analyzeEntities( |
| 64 async.Future<AnalyzeEntitiesResponse> analyzeEntities(AnalyzeEntitiesRequest r
equest) { | 62 AnalyzeEntitiesRequest request) { |
| 65 var _url = null; | 63 var _url = null; |
| 66 var _queryParams = new core.Map(); | 64 var _queryParams = new core.Map(); |
| 67 var _uploadMedia = null; | 65 var _uploadMedia = null; |
| 68 var _uploadOptions = null; | 66 var _uploadOptions = null; |
| 69 var _downloadOptions = commons.DownloadOptions.Metadata; | 67 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 70 var _body = null; | 68 var _body = null; |
| 71 | 69 |
| 72 if (request != null) { | 70 if (request != null) { |
| 73 _body = convert.JSON.encode((request).toJson()); | 71 _body = convert.JSON.encode((request).toJson()); |
| 74 } | 72 } |
| 75 | 73 |
| 76 _url = 'v1beta2/documents:analyzeEntities'; | 74 _url = 'v1beta2/documents:analyzeEntities'; |
| 77 | 75 |
| 78 var _response = _requester.request(_url, | 76 var _response = _requester.request(_url, "POST", |
| 79 "POST", | 77 body: _body, |
| 80 body: _body, | 78 queryParams: _queryParams, |
| 81 queryParams: _queryParams, | 79 uploadOptions: _uploadOptions, |
| 82 uploadOptions: _uploadOptions, | 80 uploadMedia: _uploadMedia, |
| 83 uploadMedia: _uploadMedia, | 81 downloadOptions: _downloadOptions); |
| 84 downloadOptions: _downloadOptions); | |
| 85 return _response.then((data) => new AnalyzeEntitiesResponse.fromJson(data)); | 82 return _response.then((data) => new AnalyzeEntitiesResponse.fromJson(data)); |
| 86 } | 83 } |
| 87 | 84 |
| 88 /** | 85 /// Finds entities, similar to AnalyzeEntities in the text and analyzes |
| 89 * Finds entities, similar to AnalyzeEntities in the text and analyzes | 86 /// sentiment associated with each entity and its mentions. |
| 90 * sentiment associated with each entity and its mentions. | 87 /// |
| 91 * | 88 /// [request] - The metadata request object. |
| 92 * [request] - The metadata request object. | 89 /// |
| 93 * | 90 /// Request parameters: |
| 94 * Request parameters: | 91 /// |
| 95 * | 92 /// Completes with a [AnalyzeEntitySentimentResponse]. |
| 96 * Completes with a [AnalyzeEntitySentimentResponse]. | 93 /// |
| 97 * | 94 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 98 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 95 /// an error. |
| 99 * error. | 96 /// |
| 100 * | 97 /// If the used [http.Client] completes with an error when making a REST |
| 101 * If the used [http.Client] completes with an error when making a REST call, | 98 /// call, this method will complete with the same error. |
| 102 * this method will complete with the same error. | 99 async.Future<AnalyzeEntitySentimentResponse> analyzeEntitySentiment( |
| 103 */ | 100 AnalyzeEntitySentimentRequest request) { |
| 104 async.Future<AnalyzeEntitySentimentResponse> analyzeEntitySentiment(AnalyzeEnt
itySentimentRequest request) { | |
| 105 var _url = null; | 101 var _url = null; |
| 106 var _queryParams = new core.Map(); | 102 var _queryParams = new core.Map(); |
| 107 var _uploadMedia = null; | 103 var _uploadMedia = null; |
| 108 var _uploadOptions = null; | 104 var _uploadOptions = null; |
| 109 var _downloadOptions = commons.DownloadOptions.Metadata; | 105 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 110 var _body = null; | 106 var _body = null; |
| 111 | 107 |
| 112 if (request != null) { | 108 if (request != null) { |
| 113 _body = convert.JSON.encode((request).toJson()); | 109 _body = convert.JSON.encode((request).toJson()); |
| 114 } | 110 } |
| 115 | 111 |
| 116 _url = 'v1beta2/documents:analyzeEntitySentiment'; | 112 _url = 'v1beta2/documents:analyzeEntitySentiment'; |
| 117 | 113 |
| 118 var _response = _requester.request(_url, | 114 var _response = _requester.request(_url, "POST", |
| 119 "POST", | 115 body: _body, |
| 120 body: _body, | 116 queryParams: _queryParams, |
| 121 queryParams: _queryParams, | 117 uploadOptions: _uploadOptions, |
| 122 uploadOptions: _uploadOptions, | 118 uploadMedia: _uploadMedia, |
| 123 uploadMedia: _uploadMedia, | 119 downloadOptions: _downloadOptions); |
| 124 downloadOptions: _downloadOptions); | 120 return _response |
| 125 return _response.then((data) => new AnalyzeEntitySentimentResponse.fromJson(
data)); | 121 .then((data) => new AnalyzeEntitySentimentResponse.fromJson(data)); |
| 126 } | 122 } |
| 127 | 123 |
| 128 /** | 124 /// Analyzes the sentiment of the provided text. |
| 129 * Analyzes the sentiment of the provided text. | 125 /// |
| 130 * | 126 /// [request] - The metadata request object. |
| 131 * [request] - The metadata request object. | 127 /// |
| 132 * | 128 /// Request parameters: |
| 133 * Request parameters: | 129 /// |
| 134 * | 130 /// Completes with a [AnalyzeSentimentResponse]. |
| 135 * Completes with a [AnalyzeSentimentResponse]. | 131 /// |
| 136 * | 132 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 137 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 133 /// an error. |
| 138 * error. | 134 /// |
| 139 * | 135 /// If the used [http.Client] completes with an error when making a REST |
| 140 * If the used [http.Client] completes with an error when making a REST call, | 136 /// call, this method will complete with the same error. |
| 141 * this method will complete with the same error. | 137 async.Future<AnalyzeSentimentResponse> analyzeSentiment( |
| 142 */ | 138 AnalyzeSentimentRequest request) { |
| 143 async.Future<AnalyzeSentimentResponse> analyzeSentiment(AnalyzeSentimentReques
t request) { | |
| 144 var _url = null; | 139 var _url = null; |
| 145 var _queryParams = new core.Map(); | 140 var _queryParams = new core.Map(); |
| 146 var _uploadMedia = null; | 141 var _uploadMedia = null; |
| 147 var _uploadOptions = null; | 142 var _uploadOptions = null; |
| 148 var _downloadOptions = commons.DownloadOptions.Metadata; | 143 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 149 var _body = null; | 144 var _body = null; |
| 150 | 145 |
| 151 if (request != null) { | 146 if (request != null) { |
| 152 _body = convert.JSON.encode((request).toJson()); | 147 _body = convert.JSON.encode((request).toJson()); |
| 153 } | 148 } |
| 154 | 149 |
| 155 _url = 'v1beta2/documents:analyzeSentiment'; | 150 _url = 'v1beta2/documents:analyzeSentiment'; |
| 156 | 151 |
| 157 var _response = _requester.request(_url, | 152 var _response = _requester.request(_url, "POST", |
| 158 "POST", | 153 body: _body, |
| 159 body: _body, | 154 queryParams: _queryParams, |
| 160 queryParams: _queryParams, | 155 uploadOptions: _uploadOptions, |
| 161 uploadOptions: _uploadOptions, | 156 uploadMedia: _uploadMedia, |
| 162 uploadMedia: _uploadMedia, | 157 downloadOptions: _downloadOptions); |
| 163 downloadOptions: _downloadOptions); | 158 return _response |
| 164 return _response.then((data) => new AnalyzeSentimentResponse.fromJson(data))
; | 159 .then((data) => new AnalyzeSentimentResponse.fromJson(data)); |
| 165 } | 160 } |
| 166 | 161 |
| 167 /** | 162 /// Analyzes the syntax of the text and provides sentence boundaries and |
| 168 * Analyzes the syntax of the text and provides sentence boundaries and | 163 /// tokenization along with part of speech tags, dependency trees, and other |
| 169 * tokenization along with part of speech tags, dependency trees, and other | 164 /// properties. |
| 170 * properties. | 165 /// |
| 171 * | 166 /// [request] - The metadata request object. |
| 172 * [request] - The metadata request object. | 167 /// |
| 173 * | 168 /// Request parameters: |
| 174 * Request parameters: | 169 /// |
| 175 * | 170 /// Completes with a [AnalyzeSyntaxResponse]. |
| 176 * Completes with a [AnalyzeSyntaxResponse]. | 171 /// |
| 177 * | 172 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 178 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 173 /// an error. |
| 179 * error. | 174 /// |
| 180 * | 175 /// If the used [http.Client] completes with an error when making a REST |
| 181 * If the used [http.Client] completes with an error when making a REST call, | 176 /// call, this method will complete with the same error. |
| 182 * this method will complete with the same error. | 177 async.Future<AnalyzeSyntaxResponse> analyzeSyntax( |
| 183 */ | 178 AnalyzeSyntaxRequest request) { |
| 184 async.Future<AnalyzeSyntaxResponse> analyzeSyntax(AnalyzeSyntaxRequest request
) { | |
| 185 var _url = null; | 179 var _url = null; |
| 186 var _queryParams = new core.Map(); | 180 var _queryParams = new core.Map(); |
| 187 var _uploadMedia = null; | 181 var _uploadMedia = null; |
| 188 var _uploadOptions = null; | 182 var _uploadOptions = null; |
| 189 var _downloadOptions = commons.DownloadOptions.Metadata; | 183 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 190 var _body = null; | 184 var _body = null; |
| 191 | 185 |
| 192 if (request != null) { | 186 if (request != null) { |
| 193 _body = convert.JSON.encode((request).toJson()); | 187 _body = convert.JSON.encode((request).toJson()); |
| 194 } | 188 } |
| 195 | 189 |
| 196 _url = 'v1beta2/documents:analyzeSyntax'; | 190 _url = 'v1beta2/documents:analyzeSyntax'; |
| 197 | 191 |
| 198 var _response = _requester.request(_url, | 192 var _response = _requester.request(_url, "POST", |
| 199 "POST", | 193 body: _body, |
| 200 body: _body, | 194 queryParams: _queryParams, |
| 201 queryParams: _queryParams, | 195 uploadOptions: _uploadOptions, |
| 202 uploadOptions: _uploadOptions, | 196 uploadMedia: _uploadMedia, |
| 203 uploadMedia: _uploadMedia, | 197 downloadOptions: _downloadOptions); |
| 204 downloadOptions: _downloadOptions); | |
| 205 return _response.then((data) => new AnalyzeSyntaxResponse.fromJson(data)); | 198 return _response.then((data) => new AnalyzeSyntaxResponse.fromJson(data)); |
| 206 } | 199 } |
| 207 | 200 |
| 208 /** | 201 /// A convenience method that provides all syntax, sentiment, entity, and |
| 209 * A convenience method that provides all syntax, sentiment, entity, and | 202 /// classification features in one call. |
| 210 * classification features in one call. | 203 /// |
| 211 * | 204 /// [request] - The metadata request object. |
| 212 * [request] - The metadata request object. | 205 /// |
| 213 * | 206 /// Request parameters: |
| 214 * Request parameters: | 207 /// |
| 215 * | 208 /// Completes with a [AnnotateTextResponse]. |
| 216 * Completes with a [AnnotateTextResponse]. | 209 /// |
| 217 * | 210 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 218 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 211 /// an error. |
| 219 * error. | 212 /// |
| 220 * | 213 /// If the used [http.Client] completes with an error when making a REST |
| 221 * If the used [http.Client] completes with an error when making a REST call, | 214 /// call, this method will complete with the same error. |
| 222 * this method will complete with the same error. | |
| 223 */ | |
| 224 async.Future<AnnotateTextResponse> annotateText(AnnotateTextRequest request) { | 215 async.Future<AnnotateTextResponse> annotateText(AnnotateTextRequest request) { |
| 225 var _url = null; | 216 var _url = null; |
| 226 var _queryParams = new core.Map(); | 217 var _queryParams = new core.Map(); |
| 227 var _uploadMedia = null; | 218 var _uploadMedia = null; |
| 228 var _uploadOptions = null; | 219 var _uploadOptions = null; |
| 229 var _downloadOptions = commons.DownloadOptions.Metadata; | 220 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 230 var _body = null; | 221 var _body = null; |
| 231 | 222 |
| 232 if (request != null) { | 223 if (request != null) { |
| 233 _body = convert.JSON.encode((request).toJson()); | 224 _body = convert.JSON.encode((request).toJson()); |
| 234 } | 225 } |
| 235 | 226 |
| 236 _url = 'v1beta2/documents:annotateText'; | 227 _url = 'v1beta2/documents:annotateText'; |
| 237 | 228 |
| 238 var _response = _requester.request(_url, | 229 var _response = _requester.request(_url, "POST", |
| 239 "POST", | 230 body: _body, |
| 240 body: _body, | 231 queryParams: _queryParams, |
| 241 queryParams: _queryParams, | 232 uploadOptions: _uploadOptions, |
| 242 uploadOptions: _uploadOptions, | 233 uploadMedia: _uploadMedia, |
| 243 uploadMedia: _uploadMedia, | 234 downloadOptions: _downloadOptions); |
| 244 downloadOptions: _downloadOptions); | |
| 245 return _response.then((data) => new AnnotateTextResponse.fromJson(data)); | 235 return _response.then((data) => new AnnotateTextResponse.fromJson(data)); |
| 246 } | 236 } |
| 247 | 237 |
| 238 /// Classifies a document into categories. |
| 239 /// |
| 240 /// [request] - The metadata request object. |
| 241 /// |
| 242 /// Request parameters: |
| 243 /// |
| 244 /// Completes with a [ClassifyTextResponse]. |
| 245 /// |
| 246 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 247 /// an error. |
| 248 /// |
| 249 /// If the used [http.Client] completes with an error when making a REST |
| 250 /// call, this method will complete with the same error. |
| 251 async.Future<ClassifyTextResponse> classifyText(ClassifyTextRequest request) { |
| 252 var _url = null; |
| 253 var _queryParams = new core.Map(); |
| 254 var _uploadMedia = null; |
| 255 var _uploadOptions = null; |
| 256 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 257 var _body = null; |
| 258 |
| 259 if (request != null) { |
| 260 _body = convert.JSON.encode((request).toJson()); |
| 261 } |
| 262 |
| 263 _url = 'v1beta2/documents:classifyText'; |
| 264 |
| 265 var _response = _requester.request(_url, "POST", |
| 266 body: _body, |
| 267 queryParams: _queryParams, |
| 268 uploadOptions: _uploadOptions, |
| 269 uploadMedia: _uploadMedia, |
| 270 downloadOptions: _downloadOptions); |
| 271 return _response.then((data) => new ClassifyTextResponse.fromJson(data)); |
| 272 } |
| 248 } | 273 } |
| 249 | 274 |
| 275 /// The entity analysis request message. |
| 276 class AnalyzeEntitiesRequest { |
| 277 /// Input document. |
| 278 Document document; |
| 250 | 279 |
| 251 | 280 /// The encoding type used by the API to calculate offsets. |
| 252 /** The entity analysis request message. */ | 281 /// Possible string values are: |
| 253 class AnalyzeEntitiesRequest { | 282 /// - "NONE" : If `EncodingType` is not specified, encoding-dependent |
| 254 /** Input document. */ | 283 /// information (such as |
| 255 Document document; | 284 /// `begin_offset`) will be set at `-1`. |
| 256 /** | 285 /// - "UTF8" : Encoding-dependent information (such as `begin_offset`) is |
| 257 * The encoding type used by the API to calculate offsets. | 286 /// calculated based |
| 258 * Possible string values are: | 287 /// on the UTF-8 encoding of the input. C++ and Go are examples of languages |
| 259 * - "NONE" : If `EncodingType` is not specified, encoding-dependent | 288 /// that use this encoding natively. |
| 260 * information (such as | 289 /// - "UTF16" : Encoding-dependent information (such as `begin_offset`) is |
| 261 * `begin_offset`) will be set at `-1`. | 290 /// calculated based |
| 262 * - "UTF8" : Encoding-dependent information (such as `begin_offset`) is | 291 /// on the UTF-16 encoding of the input. Java and Javascript are examples of |
| 263 * calculated based | 292 /// languages that use this encoding natively. |
| 264 * on the UTF-8 encoding of the input. C++ and Go are examples of languages | 293 /// - "UTF32" : Encoding-dependent information (such as `begin_offset`) is |
| 265 * that use this encoding natively. | 294 /// calculated based |
| 266 * - "UTF16" : Encoding-dependent information (such as `begin_offset`) is | 295 /// on the UTF-32 encoding of the input. Python is an example of a language |
| 267 * calculated based | 296 /// that uses this encoding natively. |
| 268 * on the UTF-16 encoding of the input. Java and Javascript are examples of | |
| 269 * languages that use this encoding natively. | |
| 270 * - "UTF32" : Encoding-dependent information (such as `begin_offset`) is | |
| 271 * calculated based | |
| 272 * on the UTF-32 encoding of the input. Python is an example of a language | |
| 273 * that uses this encoding natively. | |
| 274 */ | |
| 275 core.String encodingType; | 297 core.String encodingType; |
| 276 | 298 |
| 277 AnalyzeEntitiesRequest(); | 299 AnalyzeEntitiesRequest(); |
| 278 | 300 |
| 279 AnalyzeEntitiesRequest.fromJson(core.Map _json) { | 301 AnalyzeEntitiesRequest.fromJson(core.Map _json) { |
| 280 if (_json.containsKey("document")) { | 302 if (_json.containsKey("document")) { |
| 281 document = new Document.fromJson(_json["document"]); | 303 document = new Document.fromJson(_json["document"]); |
| 282 } | 304 } |
| 283 if (_json.containsKey("encodingType")) { | 305 if (_json.containsKey("encodingType")) { |
| 284 encodingType = _json["encodingType"]; | 306 encodingType = _json["encodingType"]; |
| 285 } | 307 } |
| 286 } | 308 } |
| 287 | 309 |
| 288 core.Map<core.String, core.Object> toJson() { | 310 core.Map<core.String, core.Object> toJson() { |
| 289 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 311 final core.Map<core.String, core.Object> _json = |
| 312 new core.Map<core.String, core.Object>(); |
| 290 if (document != null) { | 313 if (document != null) { |
| 291 _json["document"] = (document).toJson(); | 314 _json["document"] = (document).toJson(); |
| 292 } | 315 } |
| 293 if (encodingType != null) { | 316 if (encodingType != null) { |
| 294 _json["encodingType"] = encodingType; | 317 _json["encodingType"] = encodingType; |
| 295 } | 318 } |
| 296 return _json; | 319 return _json; |
| 297 } | 320 } |
| 298 } | 321 } |
| 299 | 322 |
| 300 /** The entity analysis response message. */ | 323 /// The entity analysis response message. |
| 301 class AnalyzeEntitiesResponse { | 324 class AnalyzeEntitiesResponse { |
| 302 /** The recognized entities in the input document. */ | 325 /// The recognized entities in the input document. |
| 303 core.List<Entity> entities; | 326 core.List<Entity> entities; |
| 304 /** | 327 |
| 305 * The language of the text, which will be the same as the language specified | 328 /// The language of the text, which will be the same as the language |
| 306 * in the request or, if not specified, the automatically-detected language. | 329 /// specified |
| 307 * See Document.language field for more details. | 330 /// in the request or, if not specified, the automatically-detected language. |
| 308 */ | 331 /// See Document.language field for more details. |
| 309 core.String language; | 332 core.String language; |
| 310 | 333 |
| 311 AnalyzeEntitiesResponse(); | 334 AnalyzeEntitiesResponse(); |
| 312 | 335 |
| 313 AnalyzeEntitiesResponse.fromJson(core.Map _json) { | 336 AnalyzeEntitiesResponse.fromJson(core.Map _json) { |
| 314 if (_json.containsKey("entities")) { | 337 if (_json.containsKey("entities")) { |
| 315 entities = _json["entities"].map((value) => new Entity.fromJson(value)).to
List(); | 338 entities = |
| 339 _json["entities"].map((value) => new Entity.fromJson(value)).toList(); |
| 316 } | 340 } |
| 317 if (_json.containsKey("language")) { | 341 if (_json.containsKey("language")) { |
| 318 language = _json["language"]; | 342 language = _json["language"]; |
| 319 } | 343 } |
| 320 } | 344 } |
| 321 | 345 |
| 322 core.Map<core.String, core.Object> toJson() { | 346 core.Map<core.String, core.Object> toJson() { |
| 323 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 347 final core.Map<core.String, core.Object> _json = |
| 348 new core.Map<core.String, core.Object>(); |
| 324 if (entities != null) { | 349 if (entities != null) { |
| 325 _json["entities"] = entities.map((value) => (value).toJson()).toList(); | 350 _json["entities"] = entities.map((value) => (value).toJson()).toList(); |
| 326 } | 351 } |
| 327 if (language != null) { | 352 if (language != null) { |
| 328 _json["language"] = language; | 353 _json["language"] = language; |
| 329 } | 354 } |
| 330 return _json; | 355 return _json; |
| 331 } | 356 } |
| 332 } | 357 } |
| 333 | 358 |
| 334 /** The entity-level sentiment analysis request message. */ | 359 /// The entity-level sentiment analysis request message. |
| 335 class AnalyzeEntitySentimentRequest { | 360 class AnalyzeEntitySentimentRequest { |
| 336 /** Input document. */ | 361 /// Input document. |
| 337 Document document; | 362 Document document; |
| 338 /** | 363 |
| 339 * The encoding type used by the API to calculate offsets. | 364 /// The encoding type used by the API to calculate offsets. |
| 340 * Possible string values are: | 365 /// Possible string values are: |
| 341 * - "NONE" : If `EncodingType` is not specified, encoding-dependent | 366 /// - "NONE" : If `EncodingType` is not specified, encoding-dependent |
| 342 * information (such as | 367 /// information (such as |
| 343 * `begin_offset`) will be set at `-1`. | 368 /// `begin_offset`) will be set at `-1`. |
| 344 * - "UTF8" : Encoding-dependent information (such as `begin_offset`) is | 369 /// - "UTF8" : Encoding-dependent information (such as `begin_offset`) is |
| 345 * calculated based | 370 /// calculated based |
| 346 * on the UTF-8 encoding of the input. C++ and Go are examples of languages | 371 /// on the UTF-8 encoding of the input. C++ and Go are examples of languages |
| 347 * that use this encoding natively. | 372 /// that use this encoding natively. |
| 348 * - "UTF16" : Encoding-dependent information (such as `begin_offset`) is | 373 /// - "UTF16" : Encoding-dependent information (such as `begin_offset`) is |
| 349 * calculated based | 374 /// calculated based |
| 350 * on the UTF-16 encoding of the input. Java and Javascript are examples of | 375 /// on the UTF-16 encoding of the input. Java and Javascript are examples of |
| 351 * languages that use this encoding natively. | 376 /// languages that use this encoding natively. |
| 352 * - "UTF32" : Encoding-dependent information (such as `begin_offset`) is | 377 /// - "UTF32" : Encoding-dependent information (such as `begin_offset`) is |
| 353 * calculated based | 378 /// calculated based |
| 354 * on the UTF-32 encoding of the input. Python is an example of a language | 379 /// on the UTF-32 encoding of the input. Python is an example of a language |
| 355 * that uses this encoding natively. | 380 /// that uses this encoding natively. |
| 356 */ | |
| 357 core.String encodingType; | 381 core.String encodingType; |
| 358 | 382 |
| 359 AnalyzeEntitySentimentRequest(); | 383 AnalyzeEntitySentimentRequest(); |
| 360 | 384 |
| 361 AnalyzeEntitySentimentRequest.fromJson(core.Map _json) { | 385 AnalyzeEntitySentimentRequest.fromJson(core.Map _json) { |
| 362 if (_json.containsKey("document")) { | 386 if (_json.containsKey("document")) { |
| 363 document = new Document.fromJson(_json["document"]); | 387 document = new Document.fromJson(_json["document"]); |
| 364 } | 388 } |
| 365 if (_json.containsKey("encodingType")) { | 389 if (_json.containsKey("encodingType")) { |
| 366 encodingType = _json["encodingType"]; | 390 encodingType = _json["encodingType"]; |
| 367 } | 391 } |
| 368 } | 392 } |
| 369 | 393 |
| 370 core.Map<core.String, core.Object> toJson() { | 394 core.Map<core.String, core.Object> toJson() { |
| 371 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 395 final core.Map<core.String, core.Object> _json = |
| 396 new core.Map<core.String, core.Object>(); |
| 372 if (document != null) { | 397 if (document != null) { |
| 373 _json["document"] = (document).toJson(); | 398 _json["document"] = (document).toJson(); |
| 374 } | 399 } |
| 375 if (encodingType != null) { | 400 if (encodingType != null) { |
| 376 _json["encodingType"] = encodingType; | 401 _json["encodingType"] = encodingType; |
| 377 } | 402 } |
| 378 return _json; | 403 return _json; |
| 379 } | 404 } |
| 380 } | 405 } |
| 381 | 406 |
| 382 /** The entity-level sentiment analysis response message. */ | 407 /// The entity-level sentiment analysis response message. |
| 383 class AnalyzeEntitySentimentResponse { | 408 class AnalyzeEntitySentimentResponse { |
| 384 /** | 409 /// The recognized entities in the input document with associated sentiments. |
| 385 * The recognized entities in the input document with associated sentiments. | |
| 386 */ | |
| 387 core.List<Entity> entities; | 410 core.List<Entity> entities; |
| 388 /** | 411 |
| 389 * The language of the text, which will be the same as the language specified | 412 /// The language of the text, which will be the same as the language |
| 390 * in the request or, if not specified, the automatically-detected language. | 413 /// specified |
| 391 * See Document.language field for more details. | 414 /// in the request or, if not specified, the automatically-detected language. |
| 392 */ | 415 /// See Document.language field for more details. |
| 393 core.String language; | 416 core.String language; |
| 394 | 417 |
| 395 AnalyzeEntitySentimentResponse(); | 418 AnalyzeEntitySentimentResponse(); |
| 396 | 419 |
| 397 AnalyzeEntitySentimentResponse.fromJson(core.Map _json) { | 420 AnalyzeEntitySentimentResponse.fromJson(core.Map _json) { |
| 398 if (_json.containsKey("entities")) { | 421 if (_json.containsKey("entities")) { |
| 399 entities = _json["entities"].map((value) => new Entity.fromJson(value)).to
List(); | 422 entities = |
| 423 _json["entities"].map((value) => new Entity.fromJson(value)).toList(); |
| 400 } | 424 } |
| 401 if (_json.containsKey("language")) { | 425 if (_json.containsKey("language")) { |
| 402 language = _json["language"]; | 426 language = _json["language"]; |
| 403 } | 427 } |
| 404 } | 428 } |
| 405 | 429 |
| 406 core.Map<core.String, core.Object> toJson() { | 430 core.Map<core.String, core.Object> toJson() { |
| 407 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 431 final core.Map<core.String, core.Object> _json = |
| 432 new core.Map<core.String, core.Object>(); |
| 408 if (entities != null) { | 433 if (entities != null) { |
| 409 _json["entities"] = entities.map((value) => (value).toJson()).toList(); | 434 _json["entities"] = entities.map((value) => (value).toJson()).toList(); |
| 410 } | 435 } |
| 411 if (language != null) { | 436 if (language != null) { |
| 412 _json["language"] = language; | 437 _json["language"] = language; |
| 413 } | 438 } |
| 414 return _json; | 439 return _json; |
| 415 } | 440 } |
| 416 } | 441 } |
| 417 | 442 |
| 418 /** The sentiment analysis request message. */ | 443 /// The sentiment analysis request message. |
| 419 class AnalyzeSentimentRequest { | 444 class AnalyzeSentimentRequest { |
| 420 /** Input document. */ | 445 /// Input document. |
| 421 Document document; | 446 Document document; |
| 422 /** | 447 |
| 423 * The encoding type used by the API to calculate sentence offsets for the | 448 /// The encoding type used by the API to calculate sentence offsets for the |
| 424 * sentence sentiment. | 449 /// sentence sentiment. |
| 425 * Possible string values are: | 450 /// Possible string values are: |
| 426 * - "NONE" : If `EncodingType` is not specified, encoding-dependent | 451 /// - "NONE" : If `EncodingType` is not specified, encoding-dependent |
| 427 * information (such as | 452 /// information (such as |
| 428 * `begin_offset`) will be set at `-1`. | 453 /// `begin_offset`) will be set at `-1`. |
| 429 * - "UTF8" : Encoding-dependent information (such as `begin_offset`) is | 454 /// - "UTF8" : Encoding-dependent information (such as `begin_offset`) is |
| 430 * calculated based | 455 /// calculated based |
| 431 * on the UTF-8 encoding of the input. C++ and Go are examples of languages | 456 /// on the UTF-8 encoding of the input. C++ and Go are examples of languages |
| 432 * that use this encoding natively. | 457 /// that use this encoding natively. |
| 433 * - "UTF16" : Encoding-dependent information (such as `begin_offset`) is | 458 /// - "UTF16" : Encoding-dependent information (such as `begin_offset`) is |
| 434 * calculated based | 459 /// calculated based |
| 435 * on the UTF-16 encoding of the input. Java and Javascript are examples of | 460 /// on the UTF-16 encoding of the input. Java and Javascript are examples of |
| 436 * languages that use this encoding natively. | 461 /// languages that use this encoding natively. |
| 437 * - "UTF32" : Encoding-dependent information (such as `begin_offset`) is | 462 /// - "UTF32" : Encoding-dependent information (such as `begin_offset`) is |
| 438 * calculated based | 463 /// calculated based |
| 439 * on the UTF-32 encoding of the input. Python is an example of a language | 464 /// on the UTF-32 encoding of the input. Python is an example of a language |
| 440 * that uses this encoding natively. | 465 /// that uses this encoding natively. |
| 441 */ | |
| 442 core.String encodingType; | 466 core.String encodingType; |
| 443 | 467 |
| 444 AnalyzeSentimentRequest(); | 468 AnalyzeSentimentRequest(); |
| 445 | 469 |
| 446 AnalyzeSentimentRequest.fromJson(core.Map _json) { | 470 AnalyzeSentimentRequest.fromJson(core.Map _json) { |
| 447 if (_json.containsKey("document")) { | 471 if (_json.containsKey("document")) { |
| 448 document = new Document.fromJson(_json["document"]); | 472 document = new Document.fromJson(_json["document"]); |
| 449 } | 473 } |
| 450 if (_json.containsKey("encodingType")) { | 474 if (_json.containsKey("encodingType")) { |
| 451 encodingType = _json["encodingType"]; | 475 encodingType = _json["encodingType"]; |
| 452 } | 476 } |
| 453 } | 477 } |
| 454 | 478 |
| 455 core.Map<core.String, core.Object> toJson() { | 479 core.Map<core.String, core.Object> toJson() { |
| 456 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 480 final core.Map<core.String, core.Object> _json = |
| 481 new core.Map<core.String, core.Object>(); |
| 457 if (document != null) { | 482 if (document != null) { |
| 458 _json["document"] = (document).toJson(); | 483 _json["document"] = (document).toJson(); |
| 459 } | 484 } |
| 460 if (encodingType != null) { | 485 if (encodingType != null) { |
| 461 _json["encodingType"] = encodingType; | 486 _json["encodingType"] = encodingType; |
| 462 } | 487 } |
| 463 return _json; | 488 return _json; |
| 464 } | 489 } |
| 465 } | 490 } |
| 466 | 491 |
| 467 /** The sentiment analysis response message. */ | 492 /// The sentiment analysis response message. |
| 468 class AnalyzeSentimentResponse { | 493 class AnalyzeSentimentResponse { |
| 469 /** The overall sentiment of the input document. */ | 494 /// The overall sentiment of the input document. |
| 470 Sentiment documentSentiment; | 495 Sentiment documentSentiment; |
| 471 /** | 496 |
| 472 * The language of the text, which will be the same as the language specified | 497 /// The language of the text, which will be the same as the language |
| 473 * in the request or, if not specified, the automatically-detected language. | 498 /// specified |
| 474 * See Document.language field for more details. | 499 /// in the request or, if not specified, the automatically-detected language. |
| 475 */ | 500 /// See Document.language field for more details. |
| 476 core.String language; | 501 core.String language; |
| 477 /** The sentiment for all the sentences in the document. */ | 502 |
| 503 /// The sentiment for all the sentences in the document. |
| 478 core.List<Sentence> sentences; | 504 core.List<Sentence> sentences; |
| 479 | 505 |
| 480 AnalyzeSentimentResponse(); | 506 AnalyzeSentimentResponse(); |
| 481 | 507 |
| 482 AnalyzeSentimentResponse.fromJson(core.Map _json) { | 508 AnalyzeSentimentResponse.fromJson(core.Map _json) { |
| 483 if (_json.containsKey("documentSentiment")) { | 509 if (_json.containsKey("documentSentiment")) { |
| 484 documentSentiment = new Sentiment.fromJson(_json["documentSentiment"]); | 510 documentSentiment = new Sentiment.fromJson(_json["documentSentiment"]); |
| 485 } | 511 } |
| 486 if (_json.containsKey("language")) { | 512 if (_json.containsKey("language")) { |
| 487 language = _json["language"]; | 513 language = _json["language"]; |
| 488 } | 514 } |
| 489 if (_json.containsKey("sentences")) { | 515 if (_json.containsKey("sentences")) { |
| 490 sentences = _json["sentences"].map((value) => new Sentence.fromJson(value)
).toList(); | 516 sentences = _json["sentences"] |
| 517 .map((value) => new Sentence.fromJson(value)) |
| 518 .toList(); |
| 491 } | 519 } |
| 492 } | 520 } |
| 493 | 521 |
| 494 core.Map<core.String, core.Object> toJson() { | 522 core.Map<core.String, core.Object> toJson() { |
| 495 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 523 final core.Map<core.String, core.Object> _json = |
| 524 new core.Map<core.String, core.Object>(); |
| 496 if (documentSentiment != null) { | 525 if (documentSentiment != null) { |
| 497 _json["documentSentiment"] = (documentSentiment).toJson(); | 526 _json["documentSentiment"] = (documentSentiment).toJson(); |
| 498 } | 527 } |
| 499 if (language != null) { | 528 if (language != null) { |
| 500 _json["language"] = language; | 529 _json["language"] = language; |
| 501 } | 530 } |
| 502 if (sentences != null) { | 531 if (sentences != null) { |
| 503 _json["sentences"] = sentences.map((value) => (value).toJson()).toList(); | 532 _json["sentences"] = sentences.map((value) => (value).toJson()).toList(); |
| 504 } | 533 } |
| 505 return _json; | 534 return _json; |
| 506 } | 535 } |
| 507 } | 536 } |
| 508 | 537 |
| 509 /** The syntax analysis request message. */ | 538 /// The syntax analysis request message. |
| 510 class AnalyzeSyntaxRequest { | 539 class AnalyzeSyntaxRequest { |
| 511 /** Input document. */ | 540 /// Input document. |
| 512 Document document; | 541 Document document; |
| 513 /** | 542 |
| 514 * The encoding type used by the API to calculate offsets. | 543 /// The encoding type used by the API to calculate offsets. |
| 515 * Possible string values are: | 544 /// Possible string values are: |
| 516 * - "NONE" : If `EncodingType` is not specified, encoding-dependent | 545 /// - "NONE" : If `EncodingType` is not specified, encoding-dependent |
| 517 * information (such as | 546 /// information (such as |
| 518 * `begin_offset`) will be set at `-1`. | 547 /// `begin_offset`) will be set at `-1`. |
| 519 * - "UTF8" : Encoding-dependent information (such as `begin_offset`) is | 548 /// - "UTF8" : Encoding-dependent information (such as `begin_offset`) is |
| 520 * calculated based | 549 /// calculated based |
| 521 * on the UTF-8 encoding of the input. C++ and Go are examples of languages | 550 /// on the UTF-8 encoding of the input. C++ and Go are examples of languages |
| 522 * that use this encoding natively. | 551 /// that use this encoding natively. |
| 523 * - "UTF16" : Encoding-dependent information (such as `begin_offset`) is | 552 /// - "UTF16" : Encoding-dependent information (such as `begin_offset`) is |
| 524 * calculated based | 553 /// calculated based |
| 525 * on the UTF-16 encoding of the input. Java and Javascript are examples of | 554 /// on the UTF-16 encoding of the input. Java and Javascript are examples of |
| 526 * languages that use this encoding natively. | 555 /// languages that use this encoding natively. |
| 527 * - "UTF32" : Encoding-dependent information (such as `begin_offset`) is | 556 /// - "UTF32" : Encoding-dependent information (such as `begin_offset`) is |
| 528 * calculated based | 557 /// calculated based |
| 529 * on the UTF-32 encoding of the input. Python is an example of a language | 558 /// on the UTF-32 encoding of the input. Python is an example of a language |
| 530 * that uses this encoding natively. | 559 /// that uses this encoding natively. |
| 531 */ | |
| 532 core.String encodingType; | 560 core.String encodingType; |
| 533 | 561 |
| 534 AnalyzeSyntaxRequest(); | 562 AnalyzeSyntaxRequest(); |
| 535 | 563 |
| 536 AnalyzeSyntaxRequest.fromJson(core.Map _json) { | 564 AnalyzeSyntaxRequest.fromJson(core.Map _json) { |
| 537 if (_json.containsKey("document")) { | 565 if (_json.containsKey("document")) { |
| 538 document = new Document.fromJson(_json["document"]); | 566 document = new Document.fromJson(_json["document"]); |
| 539 } | 567 } |
| 540 if (_json.containsKey("encodingType")) { | 568 if (_json.containsKey("encodingType")) { |
| 541 encodingType = _json["encodingType"]; | 569 encodingType = _json["encodingType"]; |
| 542 } | 570 } |
| 543 } | 571 } |
| 544 | 572 |
| 545 core.Map<core.String, core.Object> toJson() { | 573 core.Map<core.String, core.Object> toJson() { |
| 546 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 574 final core.Map<core.String, core.Object> _json = |
| 575 new core.Map<core.String, core.Object>(); |
| 547 if (document != null) { | 576 if (document != null) { |
| 548 _json["document"] = (document).toJson(); | 577 _json["document"] = (document).toJson(); |
| 549 } | 578 } |
| 550 if (encodingType != null) { | 579 if (encodingType != null) { |
| 551 _json["encodingType"] = encodingType; | 580 _json["encodingType"] = encodingType; |
| 552 } | 581 } |
| 553 return _json; | 582 return _json; |
| 554 } | 583 } |
| 555 } | 584 } |
| 556 | 585 |
| 557 /** The syntax analysis response message. */ | 586 /// The syntax analysis response message. |
| 558 class AnalyzeSyntaxResponse { | 587 class AnalyzeSyntaxResponse { |
| 559 /** | 588 /// The language of the text, which will be the same as the language |
| 560 * The language of the text, which will be the same as the language specified | 589 /// specified |
| 561 * in the request or, if not specified, the automatically-detected language. | 590 /// in the request or, if not specified, the automatically-detected language. |
| 562 * See Document.language field for more details. | 591 /// See Document.language field for more details. |
| 563 */ | |
| 564 core.String language; | 592 core.String language; |
| 565 /** Sentences in the input document. */ | 593 |
| 594 /// Sentences in the input document. |
| 566 core.List<Sentence> sentences; | 595 core.List<Sentence> sentences; |
| 567 /** Tokens, along with their syntactic information, in the input document. */ | 596 |
| 597 /// Tokens, along with their syntactic information, in the input document. |
| 568 core.List<Token> tokens; | 598 core.List<Token> tokens; |
| 569 | 599 |
| 570 AnalyzeSyntaxResponse(); | 600 AnalyzeSyntaxResponse(); |
| 571 | 601 |
| 572 AnalyzeSyntaxResponse.fromJson(core.Map _json) { | 602 AnalyzeSyntaxResponse.fromJson(core.Map _json) { |
| 573 if (_json.containsKey("language")) { | 603 if (_json.containsKey("language")) { |
| 574 language = _json["language"]; | 604 language = _json["language"]; |
| 575 } | 605 } |
| 576 if (_json.containsKey("sentences")) { | 606 if (_json.containsKey("sentences")) { |
| 577 sentences = _json["sentences"].map((value) => new Sentence.fromJson(value)
).toList(); | 607 sentences = _json["sentences"] |
| 608 .map((value) => new Sentence.fromJson(value)) |
| 609 .toList(); |
| 578 } | 610 } |
| 579 if (_json.containsKey("tokens")) { | 611 if (_json.containsKey("tokens")) { |
| 580 tokens = _json["tokens"].map((value) => new Token.fromJson(value)).toList(
); | 612 tokens = |
| 613 _json["tokens"].map((value) => new Token.fromJson(value)).toList(); |
| 581 } | 614 } |
| 582 } | 615 } |
| 583 | 616 |
| 584 core.Map<core.String, core.Object> toJson() { | 617 core.Map<core.String, core.Object> toJson() { |
| 585 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 618 final core.Map<core.String, core.Object> _json = |
| 619 new core.Map<core.String, core.Object>(); |
| 586 if (language != null) { | 620 if (language != null) { |
| 587 _json["language"] = language; | 621 _json["language"] = language; |
| 588 } | 622 } |
| 589 if (sentences != null) { | 623 if (sentences != null) { |
| 590 _json["sentences"] = sentences.map((value) => (value).toJson()).toList(); | 624 _json["sentences"] = sentences.map((value) => (value).toJson()).toList(); |
| 591 } | 625 } |
| 592 if (tokens != null) { | 626 if (tokens != null) { |
| 593 _json["tokens"] = tokens.map((value) => (value).toJson()).toList(); | 627 _json["tokens"] = tokens.map((value) => (value).toJson()).toList(); |
| 594 } | 628 } |
| 595 return _json; | 629 return _json; |
| 596 } | 630 } |
| 597 } | 631 } |
| 598 | 632 |
| 599 /** | 633 /// The request message for the text annotation API, which can perform multiple |
| 600 * The request message for the text annotation API, which can perform multiple | 634 /// analysis types (sentiment, entities, and syntax) in one call. |
| 601 * analysis types (sentiment, entities, and syntax) in one call. | |
| 602 */ | |
| 603 class AnnotateTextRequest { | 635 class AnnotateTextRequest { |
| 604 /** Input document. */ | 636 /// Input document. |
| 605 Document document; | 637 Document document; |
| 606 /** | 638 |
| 607 * The encoding type used by the API to calculate offsets. | 639 /// The encoding type used by the API to calculate offsets. |
| 608 * Possible string values are: | 640 /// Possible string values are: |
| 609 * - "NONE" : If `EncodingType` is not specified, encoding-dependent | 641 /// - "NONE" : If `EncodingType` is not specified, encoding-dependent |
| 610 * information (such as | 642 /// information (such as |
| 611 * `begin_offset`) will be set at `-1`. | 643 /// `begin_offset`) will be set at `-1`. |
| 612 * - "UTF8" : Encoding-dependent information (such as `begin_offset`) is | 644 /// - "UTF8" : Encoding-dependent information (such as `begin_offset`) is |
| 613 * calculated based | 645 /// calculated based |
| 614 * on the UTF-8 encoding of the input. C++ and Go are examples of languages | 646 /// on the UTF-8 encoding of the input. C++ and Go are examples of languages |
| 615 * that use this encoding natively. | 647 /// that use this encoding natively. |
| 616 * - "UTF16" : Encoding-dependent information (such as `begin_offset`) is | 648 /// - "UTF16" : Encoding-dependent information (such as `begin_offset`) is |
| 617 * calculated based | 649 /// calculated based |
| 618 * on the UTF-16 encoding of the input. Java and Javascript are examples of | 650 /// on the UTF-16 encoding of the input. Java and Javascript are examples of |
| 619 * languages that use this encoding natively. | 651 /// languages that use this encoding natively. |
| 620 * - "UTF32" : Encoding-dependent information (such as `begin_offset`) is | 652 /// - "UTF32" : Encoding-dependent information (such as `begin_offset`) is |
| 621 * calculated based | 653 /// calculated based |
| 622 * on the UTF-32 encoding of the input. Python is an example of a language | 654 /// on the UTF-32 encoding of the input. Python is an example of a language |
| 623 * that uses this encoding natively. | 655 /// that uses this encoding natively. |
| 624 */ | |
| 625 core.String encodingType; | 656 core.String encodingType; |
| 626 /** The enabled features. */ | 657 |
| 658 /// The enabled features. |
| 627 Features features; | 659 Features features; |
| 628 | 660 |
| 629 AnnotateTextRequest(); | 661 AnnotateTextRequest(); |
| 630 | 662 |
| 631 AnnotateTextRequest.fromJson(core.Map _json) { | 663 AnnotateTextRequest.fromJson(core.Map _json) { |
| 632 if (_json.containsKey("document")) { | 664 if (_json.containsKey("document")) { |
| 633 document = new Document.fromJson(_json["document"]); | 665 document = new Document.fromJson(_json["document"]); |
| 634 } | 666 } |
| 635 if (_json.containsKey("encodingType")) { | 667 if (_json.containsKey("encodingType")) { |
| 636 encodingType = _json["encodingType"]; | 668 encodingType = _json["encodingType"]; |
| 637 } | 669 } |
| 638 if (_json.containsKey("features")) { | 670 if (_json.containsKey("features")) { |
| 639 features = new Features.fromJson(_json["features"]); | 671 features = new Features.fromJson(_json["features"]); |
| 640 } | 672 } |
| 641 } | 673 } |
| 642 | 674 |
| 643 core.Map<core.String, core.Object> toJson() { | 675 core.Map<core.String, core.Object> toJson() { |
| 644 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 676 final core.Map<core.String, core.Object> _json = |
| 677 new core.Map<core.String, core.Object>(); |
| 645 if (document != null) { | 678 if (document != null) { |
| 646 _json["document"] = (document).toJson(); | 679 _json["document"] = (document).toJson(); |
| 647 } | 680 } |
| 648 if (encodingType != null) { | 681 if (encodingType != null) { |
| 649 _json["encodingType"] = encodingType; | 682 _json["encodingType"] = encodingType; |
| 650 } | 683 } |
| 651 if (features != null) { | 684 if (features != null) { |
| 652 _json["features"] = (features).toJson(); | 685 _json["features"] = (features).toJson(); |
| 653 } | 686 } |
| 654 return _json; | 687 return _json; |
| 655 } | 688 } |
| 656 } | 689 } |
| 657 | 690 |
| 658 /** The text annotations response message. */ | 691 /// The text annotations response message. |
| 659 class AnnotateTextResponse { | 692 class AnnotateTextResponse { |
| 660 /** | 693 /// Categories identified in the input document. |
| 661 * The overall sentiment for the document. Populated if the user enables | 694 core.List<ClassificationCategory> categories; |
| 662 * AnnotateTextRequest.Features.extract_document_sentiment. | 695 |
| 663 */ | 696 /// The overall sentiment for the document. Populated if the user enables |
| 697 /// AnnotateTextRequest.Features.extract_document_sentiment. |
| 664 Sentiment documentSentiment; | 698 Sentiment documentSentiment; |
| 665 /** | 699 |
| 666 * Entities, along with their semantic information, in the input document. | 700 /// Entities, along with their semantic information, in the input document. |
| 667 * Populated if the user enables | 701 /// Populated if the user enables |
| 668 * AnnotateTextRequest.Features.extract_entities. | 702 /// AnnotateTextRequest.Features.extract_entities. |
| 669 */ | |
| 670 core.List<Entity> entities; | 703 core.List<Entity> entities; |
| 671 /** | 704 |
| 672 * The language of the text, which will be the same as the language specified | 705 /// The language of the text, which will be the same as the language |
| 673 * in the request or, if not specified, the automatically-detected language. | 706 /// specified |
| 674 * See Document.language field for more details. | 707 /// in the request or, if not specified, the automatically-detected language. |
| 675 */ | 708 /// See Document.language field for more details. |
| 676 core.String language; | 709 core.String language; |
| 677 /** | 710 |
| 678 * Sentences in the input document. Populated if the user enables | 711 /// Sentences in the input document. Populated if the user enables |
| 679 * AnnotateTextRequest.Features.extract_syntax. | 712 /// AnnotateTextRequest.Features.extract_syntax. |
| 680 */ | |
| 681 core.List<Sentence> sentences; | 713 core.List<Sentence> sentences; |
| 682 /** | 714 |
| 683 * Tokens, along with their syntactic information, in the input document. | 715 /// Tokens, along with their syntactic information, in the input document. |
| 684 * Populated if the user enables | 716 /// Populated if the user enables |
| 685 * AnnotateTextRequest.Features.extract_syntax. | 717 /// AnnotateTextRequest.Features.extract_syntax. |
| 686 */ | |
| 687 core.List<Token> tokens; | 718 core.List<Token> tokens; |
| 688 | 719 |
| 689 AnnotateTextResponse(); | 720 AnnotateTextResponse(); |
| 690 | 721 |
| 691 AnnotateTextResponse.fromJson(core.Map _json) { | 722 AnnotateTextResponse.fromJson(core.Map _json) { |
| 723 if (_json.containsKey("categories")) { |
| 724 categories = _json["categories"] |
| 725 .map((value) => new ClassificationCategory.fromJson(value)) |
| 726 .toList(); |
| 727 } |
| 692 if (_json.containsKey("documentSentiment")) { | 728 if (_json.containsKey("documentSentiment")) { |
| 693 documentSentiment = new Sentiment.fromJson(_json["documentSentiment"]); | 729 documentSentiment = new Sentiment.fromJson(_json["documentSentiment"]); |
| 694 } | 730 } |
| 695 if (_json.containsKey("entities")) { | 731 if (_json.containsKey("entities")) { |
| 696 entities = _json["entities"].map((value) => new Entity.fromJson(value)).to
List(); | 732 entities = |
| 733 _json["entities"].map((value) => new Entity.fromJson(value)).toList(); |
| 697 } | 734 } |
| 698 if (_json.containsKey("language")) { | 735 if (_json.containsKey("language")) { |
| 699 language = _json["language"]; | 736 language = _json["language"]; |
| 700 } | 737 } |
| 701 if (_json.containsKey("sentences")) { | 738 if (_json.containsKey("sentences")) { |
| 702 sentences = _json["sentences"].map((value) => new Sentence.fromJson(value)
).toList(); | 739 sentences = _json["sentences"] |
| 740 .map((value) => new Sentence.fromJson(value)) |
| 741 .toList(); |
| 703 } | 742 } |
| 704 if (_json.containsKey("tokens")) { | 743 if (_json.containsKey("tokens")) { |
| 705 tokens = _json["tokens"].map((value) => new Token.fromJson(value)).toList(
); | 744 tokens = |
| 745 _json["tokens"].map((value) => new Token.fromJson(value)).toList(); |
| 706 } | 746 } |
| 707 } | 747 } |
| 708 | 748 |
| 709 core.Map<core.String, core.Object> toJson() { | 749 core.Map<core.String, core.Object> toJson() { |
| 710 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 750 final core.Map<core.String, core.Object> _json = |
| 751 new core.Map<core.String, core.Object>(); |
| 752 if (categories != null) { |
| 753 _json["categories"] = |
| 754 categories.map((value) => (value).toJson()).toList(); |
| 755 } |
| 711 if (documentSentiment != null) { | 756 if (documentSentiment != null) { |
| 712 _json["documentSentiment"] = (documentSentiment).toJson(); | 757 _json["documentSentiment"] = (documentSentiment).toJson(); |
| 713 } | 758 } |
| 714 if (entities != null) { | 759 if (entities != null) { |
| 715 _json["entities"] = entities.map((value) => (value).toJson()).toList(); | 760 _json["entities"] = entities.map((value) => (value).toJson()).toList(); |
| 716 } | 761 } |
| 717 if (language != null) { | 762 if (language != null) { |
| 718 _json["language"] = language; | 763 _json["language"] = language; |
| 719 } | 764 } |
| 720 if (sentences != null) { | 765 if (sentences != null) { |
| 721 _json["sentences"] = sentences.map((value) => (value).toJson()).toList(); | 766 _json["sentences"] = sentences.map((value) => (value).toJson()).toList(); |
| 722 } | 767 } |
| 723 if (tokens != null) { | 768 if (tokens != null) { |
| 724 _json["tokens"] = tokens.map((value) => (value).toJson()).toList(); | 769 _json["tokens"] = tokens.map((value) => (value).toJson()).toList(); |
| 725 } | 770 } |
| 726 return _json; | 771 return _json; |
| 727 } | 772 } |
| 728 } | 773 } |
| 729 | 774 |
| 730 /** Represents dependency parse tree information for a token. */ | 775 /// Represents a category returned from the text classifier. |
| 776 class ClassificationCategory { |
| 777 /// The classifier's confidence of the category. Number represents how |
| 778 /// certain |
| 779 /// the classifier is that this category represents the given text. |
| 780 core.double confidence; |
| 781 |
| 782 /// The name of the category representing the document. |
| 783 core.String name; |
| 784 |
| 785 ClassificationCategory(); |
| 786 |
| 787 ClassificationCategory.fromJson(core.Map _json) { |
| 788 if (_json.containsKey("confidence")) { |
| 789 confidence = _json["confidence"]; |
| 790 } |
| 791 if (_json.containsKey("name")) { |
| 792 name = _json["name"]; |
| 793 } |
| 794 } |
| 795 |
| 796 core.Map<core.String, core.Object> toJson() { |
| 797 final core.Map<core.String, core.Object> _json = |
| 798 new core.Map<core.String, core.Object>(); |
| 799 if (confidence != null) { |
| 800 _json["confidence"] = confidence; |
| 801 } |
| 802 if (name != null) { |
| 803 _json["name"] = name; |
| 804 } |
| 805 return _json; |
| 806 } |
| 807 } |
| 808 |
| 809 /// The document classification request message. |
| 810 class ClassifyTextRequest { |
| 811 /// Input document. |
| 812 Document document; |
| 813 |
| 814 ClassifyTextRequest(); |
| 815 |
| 816 ClassifyTextRequest.fromJson(core.Map _json) { |
| 817 if (_json.containsKey("document")) { |
| 818 document = new Document.fromJson(_json["document"]); |
| 819 } |
| 820 } |
| 821 |
| 822 core.Map<core.String, core.Object> toJson() { |
| 823 final core.Map<core.String, core.Object> _json = |
| 824 new core.Map<core.String, core.Object>(); |
| 825 if (document != null) { |
| 826 _json["document"] = (document).toJson(); |
| 827 } |
| 828 return _json; |
| 829 } |
| 830 } |
| 831 |
| 832 /// The document classification response message. |
| 833 class ClassifyTextResponse { |
| 834 /// Categories representing the input document. |
| 835 core.List<ClassificationCategory> categories; |
| 836 |
| 837 ClassifyTextResponse(); |
| 838 |
| 839 ClassifyTextResponse.fromJson(core.Map _json) { |
| 840 if (_json.containsKey("categories")) { |
| 841 categories = _json["categories"] |
| 842 .map((value) => new ClassificationCategory.fromJson(value)) |
| 843 .toList(); |
| 844 } |
| 845 } |
| 846 |
| 847 core.Map<core.String, core.Object> toJson() { |
| 848 final core.Map<core.String, core.Object> _json = |
| 849 new core.Map<core.String, core.Object>(); |
| 850 if (categories != null) { |
| 851 _json["categories"] = |
| 852 categories.map((value) => (value).toJson()).toList(); |
| 853 } |
| 854 return _json; |
| 855 } |
| 856 } |
| 857 |
| 858 /// Represents dependency parse tree information for a token. |
| 731 class DependencyEdge { | 859 class DependencyEdge { |
| 732 /** | 860 /// Represents the head of this token in the dependency tree. |
| 733 * Represents the head of this token in the dependency tree. | 861 /// This is the index of the token which has an arc going to this token. |
| 734 * This is the index of the token which has an arc going to this token. | 862 /// The index is the position of the token in the array of tokens returned |
| 735 * The index is the position of the token in the array of tokens returned | 863 /// by the API method. If this token is a root token, then the |
| 736 * by the API method. If this token is a root token, then the | 864 /// `head_token_index` is its own index. |
| 737 * `head_token_index` is its own index. | |
| 738 */ | |
| 739 core.int headTokenIndex; | 865 core.int headTokenIndex; |
| 740 /** | 866 |
| 741 * The parse label for the token. | 867 /// The parse label for the token. |
| 742 * Possible string values are: | 868 /// Possible string values are: |
| 743 * - "UNKNOWN" : Unknown | 869 /// - "UNKNOWN" : Unknown |
| 744 * - "ABBREV" : Abbreviation modifier | 870 /// - "ABBREV" : Abbreviation modifier |
| 745 * - "ACOMP" : Adjectival complement | 871 /// - "ACOMP" : Adjectival complement |
| 746 * - "ADVCL" : Adverbial clause modifier | 872 /// - "ADVCL" : Adverbial clause modifier |
| 747 * - "ADVMOD" : Adverbial modifier | 873 /// - "ADVMOD" : Adverbial modifier |
| 748 * - "AMOD" : Adjectival modifier of an NP | 874 /// - "AMOD" : Adjectival modifier of an NP |
| 749 * - "APPOS" : Appositional modifier of an NP | 875 /// - "APPOS" : Appositional modifier of an NP |
| 750 * - "ATTR" : Attribute dependent of a copular verb | 876 /// - "ATTR" : Attribute dependent of a copular verb |
| 751 * - "AUX" : Auxiliary (non-main) verb | 877 /// - "AUX" : Auxiliary (non-main) verb |
| 752 * - "AUXPASS" : Passive auxiliary | 878 /// - "AUXPASS" : Passive auxiliary |
| 753 * - "CC" : Coordinating conjunction | 879 /// - "CC" : Coordinating conjunction |
| 754 * - "CCOMP" : Clausal complement of a verb or adjective | 880 /// - "CCOMP" : Clausal complement of a verb or adjective |
| 755 * - "CONJ" : Conjunct | 881 /// - "CONJ" : Conjunct |
| 756 * - "CSUBJ" : Clausal subject | 882 /// - "CSUBJ" : Clausal subject |
| 757 * - "CSUBJPASS" : Clausal passive subject | 883 /// - "CSUBJPASS" : Clausal passive subject |
| 758 * - "DEP" : Dependency (unable to determine) | 884 /// - "DEP" : Dependency (unable to determine) |
| 759 * - "DET" : Determiner | 885 /// - "DET" : Determiner |
| 760 * - "DISCOURSE" : Discourse | 886 /// - "DISCOURSE" : Discourse |
| 761 * - "DOBJ" : Direct object | 887 /// - "DOBJ" : Direct object |
| 762 * - "EXPL" : Expletive | 888 /// - "EXPL" : Expletive |
| 763 * - "GOESWITH" : Goes with (part of a word in a text not well edited) | 889 /// - "GOESWITH" : Goes with (part of a word in a text not well edited) |
| 764 * - "IOBJ" : Indirect object | 890 /// - "IOBJ" : Indirect object |
| 765 * - "MARK" : Marker (word introducing a subordinate clause) | 891 /// - "MARK" : Marker (word introducing a subordinate clause) |
| 766 * - "MWE" : Multi-word expression | 892 /// - "MWE" : Multi-word expression |
| 767 * - "MWV" : Multi-word verbal expression | 893 /// - "MWV" : Multi-word verbal expression |
| 768 * - "NEG" : Negation modifier | 894 /// - "NEG" : Negation modifier |
| 769 * - "NN" : Noun compound modifier | 895 /// - "NN" : Noun compound modifier |
| 770 * - "NPADVMOD" : Noun phrase used as an adverbial modifier | 896 /// - "NPADVMOD" : Noun phrase used as an adverbial modifier |
| 771 * - "NSUBJ" : Nominal subject | 897 /// - "NSUBJ" : Nominal subject |
| 772 * - "NSUBJPASS" : Passive nominal subject | 898 /// - "NSUBJPASS" : Passive nominal subject |
| 773 * - "NUM" : Numeric modifier of a noun | 899 /// - "NUM" : Numeric modifier of a noun |
| 774 * - "NUMBER" : Element of compound number | 900 /// - "NUMBER" : Element of compound number |
| 775 * - "P" : Punctuation mark | 901 /// - "P" : Punctuation mark |
| 776 * - "PARATAXIS" : Parataxis relation | 902 /// - "PARATAXIS" : Parataxis relation |
| 777 * - "PARTMOD" : Participial modifier | 903 /// - "PARTMOD" : Participial modifier |
| 778 * - "PCOMP" : The complement of a preposition is a clause | 904 /// - "PCOMP" : The complement of a preposition is a clause |
| 779 * - "POBJ" : Object of a preposition | 905 /// - "POBJ" : Object of a preposition |
| 780 * - "POSS" : Possession modifier | 906 /// - "POSS" : Possession modifier |
| 781 * - "POSTNEG" : Postverbal negative particle | 907 /// - "POSTNEG" : Postverbal negative particle |
| 782 * - "PRECOMP" : Predicate complement | 908 /// - "PRECOMP" : Predicate complement |
| 783 * - "PRECONJ" : Preconjunt | 909 /// - "PRECONJ" : Preconjunt |
| 784 * - "PREDET" : Predeterminer | 910 /// - "PREDET" : Predeterminer |
| 785 * - "PREF" : Prefix | 911 /// - "PREF" : Prefix |
| 786 * - "PREP" : Prepositional modifier | 912 /// - "PREP" : Prepositional modifier |
| 787 * - "PRONL" : The relationship between a verb and verbal morpheme | 913 /// - "PRONL" : The relationship between a verb and verbal morpheme |
| 788 * - "PRT" : Particle | 914 /// - "PRT" : Particle |
| 789 * - "PS" : Associative or possessive marker | 915 /// - "PS" : Associative or possessive marker |
| 790 * - "QUANTMOD" : Quantifier phrase modifier | 916 /// - "QUANTMOD" : Quantifier phrase modifier |
| 791 * - "RCMOD" : Relative clause modifier | 917 /// - "RCMOD" : Relative clause modifier |
| 792 * - "RCMODREL" : Complementizer in relative clause | 918 /// - "RCMODREL" : Complementizer in relative clause |
| 793 * - "RDROP" : Ellipsis without a preceding predicate | 919 /// - "RDROP" : Ellipsis without a preceding predicate |
| 794 * - "REF" : Referent | 920 /// - "REF" : Referent |
| 795 * - "REMNANT" : Remnant | 921 /// - "REMNANT" : Remnant |
| 796 * - "REPARANDUM" : Reparandum | 922 /// - "REPARANDUM" : Reparandum |
| 797 * - "ROOT" : Root | 923 /// - "ROOT" : Root |
| 798 * - "SNUM" : Suffix specifying a unit of number | 924 /// - "SNUM" : Suffix specifying a unit of number |
| 799 * - "SUFF" : Suffix | 925 /// - "SUFF" : Suffix |
| 800 * - "TMOD" : Temporal modifier | 926 /// - "TMOD" : Temporal modifier |
| 801 * - "TOPIC" : Topic marker | 927 /// - "TOPIC" : Topic marker |
| 802 * - "VMOD" : Clause headed by an infinite form of the verb that modifies a | 928 /// - "VMOD" : Clause headed by an infinite form of the verb that modifies a |
| 803 * noun | 929 /// noun |
| 804 * - "VOCATIVE" : Vocative | 930 /// - "VOCATIVE" : Vocative |
| 805 * - "XCOMP" : Open clausal complement | 931 /// - "XCOMP" : Open clausal complement |
| 806 * - "SUFFIX" : Name suffix | 932 /// - "SUFFIX" : Name suffix |
| 807 * - "TITLE" : Name title | 933 /// - "TITLE" : Name title |
| 808 * - "ADVPHMOD" : Adverbial phrase modifier | 934 /// - "ADVPHMOD" : Adverbial phrase modifier |
| 809 * - "AUXCAUS" : Causative auxiliary | 935 /// - "AUXCAUS" : Causative auxiliary |
| 810 * - "AUXVV" : Helper auxiliary | 936 /// - "AUXVV" : Helper auxiliary |
| 811 * - "DTMOD" : Rentaishi (Prenominal modifier) | 937 /// - "DTMOD" : Rentaishi (Prenominal modifier) |
| 812 * - "FOREIGN" : Foreign words | 938 /// - "FOREIGN" : Foreign words |
| 813 * - "KW" : Keyword | 939 /// - "KW" : Keyword |
| 814 * - "LIST" : List for chains of comparable items | 940 /// - "LIST" : List for chains of comparable items |
| 815 * - "NOMC" : Nominalized clause | 941 /// - "NOMC" : Nominalized clause |
| 816 * - "NOMCSUBJ" : Nominalized clausal subject | 942 /// - "NOMCSUBJ" : Nominalized clausal subject |
| 817 * - "NOMCSUBJPASS" : Nominalized clausal passive | 943 /// - "NOMCSUBJPASS" : Nominalized clausal passive |
| 818 * - "NUMC" : Compound of numeric modifier | 944 /// - "NUMC" : Compound of numeric modifier |
| 819 * - "COP" : Copula | 945 /// - "COP" : Copula |
| 820 * - "DISLOCATED" : Dislocated relation (for fronted/topicalized elements) | 946 /// - "DISLOCATED" : Dislocated relation (for fronted/topicalized elements) |
| 821 */ | |
| 822 core.String label; | 947 core.String label; |
| 823 | 948 |
| 824 DependencyEdge(); | 949 DependencyEdge(); |
| 825 | 950 |
| 826 DependencyEdge.fromJson(core.Map _json) { | 951 DependencyEdge.fromJson(core.Map _json) { |
| 827 if (_json.containsKey("headTokenIndex")) { | 952 if (_json.containsKey("headTokenIndex")) { |
| 828 headTokenIndex = _json["headTokenIndex"]; | 953 headTokenIndex = _json["headTokenIndex"]; |
| 829 } | 954 } |
| 830 if (_json.containsKey("label")) { | 955 if (_json.containsKey("label")) { |
| 831 label = _json["label"]; | 956 label = _json["label"]; |
| 832 } | 957 } |
| 833 } | 958 } |
| 834 | 959 |
| 835 core.Map<core.String, core.Object> toJson() { | 960 core.Map<core.String, core.Object> toJson() { |
| 836 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 961 final core.Map<core.String, core.Object> _json = |
| 962 new core.Map<core.String, core.Object>(); |
| 837 if (headTokenIndex != null) { | 963 if (headTokenIndex != null) { |
| 838 _json["headTokenIndex"] = headTokenIndex; | 964 _json["headTokenIndex"] = headTokenIndex; |
| 839 } | 965 } |
| 840 if (label != null) { | 966 if (label != null) { |
| 841 _json["label"] = label; | 967 _json["label"] = label; |
| 842 } | 968 } |
| 843 return _json; | 969 return _json; |
| 844 } | 970 } |
| 845 } | 971 } |
| 846 | 972 |
| 847 /** | 973 /// ################################################################ # |
| 848 * ################################################################ # | 974 /// |
| 849 * | 975 /// Represents the input to API methods. |
| 850 * Represents the input to API methods. | |
| 851 */ | |
| 852 class Document { | 976 class Document { |
| 853 /** The content of the input in string format. */ | 977 /// The content of the input in string format. |
| 854 core.String content; | 978 core.String content; |
| 855 /** | 979 |
| 856 * The Google Cloud Storage URI where the file content is located. | 980 /// The Google Cloud Storage URI where the file content is located. |
| 857 * This URI must be of the form: gs://bucket_name/object_name. For more | 981 /// This URI must be of the form: gs://bucket_name/object_name. For more |
| 858 * details, see https://cloud.google.com/storage/docs/reference-uris. | 982 /// details, see https://cloud.google.com/storage/docs/reference-uris. |
| 859 * NOTE: Cloud Storage object versioning is not supported. | 983 /// NOTE: Cloud Storage object versioning is not supported. |
| 860 */ | |
| 861 core.String gcsContentUri; | 984 core.String gcsContentUri; |
| 862 /** | 985 |
| 863 * The language of the document (if not specified, the language is | 986 /// The language of the document (if not specified, the language is |
| 864 * automatically detected). Both ISO and BCP-47 language codes are | 987 /// automatically detected). Both ISO and BCP-47 language codes are |
| 865 * accepted.<br> | 988 /// accepted.<br> |
| 866 * [Language Support](/natural-language/docs/languages) | 989 /// [Language Support](/natural-language/docs/languages) |
| 867 * lists currently supported languages for each API method. | 990 /// lists currently supported languages for each API method. |
| 868 * If the language (either specified by the caller or automatically detected) | 991 /// If the language (either specified by the caller or automatically |
| 869 * is not supported by the called API method, an `INVALID_ARGUMENT` error | 992 /// detected) |
| 870 * is returned. | 993 /// is not supported by the called API method, an `INVALID_ARGUMENT` error |
| 871 */ | 994 /// is returned. |
| 872 core.String language; | 995 core.String language; |
| 873 /** | 996 |
| 874 * Required. If the type is not set or is `TYPE_UNSPECIFIED`, | 997 /// Required. If the type is not set or is `TYPE_UNSPECIFIED`, |
| 875 * returns an `INVALID_ARGUMENT` error. | 998 /// returns an `INVALID_ARGUMENT` error. |
| 876 * Possible string values are: | 999 /// Possible string values are: |
| 877 * - "TYPE_UNSPECIFIED" : The content type is not specified. | 1000 /// - "TYPE_UNSPECIFIED" : The content type is not specified. |
| 878 * - "PLAIN_TEXT" : Plain text | 1001 /// - "PLAIN_TEXT" : Plain text |
| 879 * - "HTML" : HTML | 1002 /// - "HTML" : HTML |
| 880 */ | |
| 881 core.String type; | 1003 core.String type; |
| 882 | 1004 |
| 883 Document(); | 1005 Document(); |
| 884 | 1006 |
| 885 Document.fromJson(core.Map _json) { | 1007 Document.fromJson(core.Map _json) { |
| 886 if (_json.containsKey("content")) { | 1008 if (_json.containsKey("content")) { |
| 887 content = _json["content"]; | 1009 content = _json["content"]; |
| 888 } | 1010 } |
| 889 if (_json.containsKey("gcsContentUri")) { | 1011 if (_json.containsKey("gcsContentUri")) { |
| 890 gcsContentUri = _json["gcsContentUri"]; | 1012 gcsContentUri = _json["gcsContentUri"]; |
| 891 } | 1013 } |
| 892 if (_json.containsKey("language")) { | 1014 if (_json.containsKey("language")) { |
| 893 language = _json["language"]; | 1015 language = _json["language"]; |
| 894 } | 1016 } |
| 895 if (_json.containsKey("type")) { | 1017 if (_json.containsKey("type")) { |
| 896 type = _json["type"]; | 1018 type = _json["type"]; |
| 897 } | 1019 } |
| 898 } | 1020 } |
| 899 | 1021 |
| 900 core.Map<core.String, core.Object> toJson() { | 1022 core.Map<core.String, core.Object> toJson() { |
| 901 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1023 final core.Map<core.String, core.Object> _json = |
| 1024 new core.Map<core.String, core.Object>(); |
| 902 if (content != null) { | 1025 if (content != null) { |
| 903 _json["content"] = content; | 1026 _json["content"] = content; |
| 904 } | 1027 } |
| 905 if (gcsContentUri != null) { | 1028 if (gcsContentUri != null) { |
| 906 _json["gcsContentUri"] = gcsContentUri; | 1029 _json["gcsContentUri"] = gcsContentUri; |
| 907 } | 1030 } |
| 908 if (language != null) { | 1031 if (language != null) { |
| 909 _json["language"] = language; | 1032 _json["language"] = language; |
| 910 } | 1033 } |
| 911 if (type != null) { | 1034 if (type != null) { |
| 912 _json["type"] = type; | 1035 _json["type"] = type; |
| 913 } | 1036 } |
| 914 return _json; | 1037 return _json; |
| 915 } | 1038 } |
| 916 } | 1039 } |
| 917 | 1040 |
| 918 /** | 1041 /// Represents a phrase in the text that is a known entity, such as |
| 919 * Represents a phrase in the text that is a known entity, such as | 1042 /// a person, an organization, or location. The API associates information, |
| 920 * a person, an organization, or location. The API associates information, such | 1043 /// such |
| 921 * as salience and mentions, with entities. | 1044 /// as salience and mentions, with entities. |
| 922 */ | |
| 923 class Entity { | 1045 class Entity { |
| 924 /** | 1046 /// The mentions of this entity in the input document. The API currently |
| 925 * The mentions of this entity in the input document. The API currently | 1047 /// supports proper noun mentions. |
| 926 * supports proper noun mentions. | |
| 927 */ | |
| 928 core.List<EntityMention> mentions; | 1048 core.List<EntityMention> mentions; |
| 929 /** | 1049 |
| 930 * Metadata associated with the entity. | 1050 /// Metadata associated with the entity. |
| 931 * | 1051 /// |
| 932 * Currently, Wikipedia URLs and Knowledge Graph MIDs are provided, if | 1052 /// Currently, Wikipedia URLs and Knowledge Graph MIDs are provided, if |
| 933 * available. The associated keys are "wikipedia_url" and "mid", respectively. | 1053 /// available. The associated keys are "wikipedia_url" and "mid", |
| 934 */ | 1054 /// respectively. |
| 935 core.Map<core.String, core.String> metadata; | 1055 core.Map<core.String, core.String> metadata; |
| 936 /** The representative name for the entity. */ | 1056 |
| 1057 /// The representative name for the entity. |
| 937 core.String name; | 1058 core.String name; |
| 938 /** | 1059 |
| 939 * The salience score associated with the entity in the [0, 1.0] range. | 1060 /// The salience score associated with the entity in the [0, 1.0] range. |
| 940 * | 1061 /// |
| 941 * The salience score for an entity provides information about the | 1062 /// The salience score for an entity provides information about the |
| 942 * importance or centrality of that entity to the entire document text. | 1063 /// importance or centrality of that entity to the entire document text. |
| 943 * Scores closer to 0 are less salient, while scores closer to 1.0 are highly | 1064 /// Scores closer to 0 are less salient, while scores closer to 1.0 are |
| 944 * salient. | 1065 /// highly |
| 945 */ | 1066 /// salient. |
| 946 core.double salience; | 1067 core.double salience; |
| 947 /** | 1068 |
| 948 * For calls to AnalyzeEntitySentiment or if | 1069 /// For calls to AnalyzeEntitySentiment or if |
| 949 * AnnotateTextRequest.Features.extract_entity_sentiment is set to | 1070 /// AnnotateTextRequest.Features.extract_entity_sentiment is set to |
| 950 * true, this field will contain the aggregate sentiment expressed for this | 1071 /// true, this field will contain the aggregate sentiment expressed for this |
| 951 * entity in the provided document. | 1072 /// entity in the provided document. |
| 952 */ | |
| 953 Sentiment sentiment; | 1073 Sentiment sentiment; |
| 954 /** | 1074 |
| 955 * The entity type. | 1075 /// The entity type. |
| 956 * Possible string values are: | 1076 /// Possible string values are: |
| 957 * - "UNKNOWN" : Unknown | 1077 /// - "UNKNOWN" : Unknown |
| 958 * - "PERSON" : Person | 1078 /// - "PERSON" : Person |
| 959 * - "LOCATION" : Location | 1079 /// - "LOCATION" : Location |
| 960 * - "ORGANIZATION" : Organization | 1080 /// - "ORGANIZATION" : Organization |
| 961 * - "EVENT" : Event | 1081 /// - "EVENT" : Event |
| 962 * - "WORK_OF_ART" : Work of art | 1082 /// - "WORK_OF_ART" : Work of art |
| 963 * - "CONSUMER_GOOD" : Consumer goods | 1083 /// - "CONSUMER_GOOD" : Consumer goods |
| 964 * - "OTHER" : Other types | 1084 /// - "OTHER" : Other types |
| 965 */ | |
| 966 core.String type; | 1085 core.String type; |
| 967 | 1086 |
| 968 Entity(); | 1087 Entity(); |
| 969 | 1088 |
| 970 Entity.fromJson(core.Map _json) { | 1089 Entity.fromJson(core.Map _json) { |
| 971 if (_json.containsKey("mentions")) { | 1090 if (_json.containsKey("mentions")) { |
| 972 mentions = _json["mentions"].map((value) => new EntityMention.fromJson(val
ue)).toList(); | 1091 mentions = _json["mentions"] |
| 1092 .map((value) => new EntityMention.fromJson(value)) |
| 1093 .toList(); |
| 973 } | 1094 } |
| 974 if (_json.containsKey("metadata")) { | 1095 if (_json.containsKey("metadata")) { |
| 975 metadata = _json["metadata"]; | 1096 metadata = _json["metadata"]; |
| 976 } | 1097 } |
| 977 if (_json.containsKey("name")) { | 1098 if (_json.containsKey("name")) { |
| 978 name = _json["name"]; | 1099 name = _json["name"]; |
| 979 } | 1100 } |
| 980 if (_json.containsKey("salience")) { | 1101 if (_json.containsKey("salience")) { |
| 981 salience = _json["salience"]; | 1102 salience = _json["salience"]; |
| 982 } | 1103 } |
| 983 if (_json.containsKey("sentiment")) { | 1104 if (_json.containsKey("sentiment")) { |
| 984 sentiment = new Sentiment.fromJson(_json["sentiment"]); | 1105 sentiment = new Sentiment.fromJson(_json["sentiment"]); |
| 985 } | 1106 } |
| 986 if (_json.containsKey("type")) { | 1107 if (_json.containsKey("type")) { |
| 987 type = _json["type"]; | 1108 type = _json["type"]; |
| 988 } | 1109 } |
| 989 } | 1110 } |
| 990 | 1111 |
| 991 core.Map<core.String, core.Object> toJson() { | 1112 core.Map<core.String, core.Object> toJson() { |
| 992 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1113 final core.Map<core.String, core.Object> _json = |
| 1114 new core.Map<core.String, core.Object>(); |
| 993 if (mentions != null) { | 1115 if (mentions != null) { |
| 994 _json["mentions"] = mentions.map((value) => (value).toJson()).toList(); | 1116 _json["mentions"] = mentions.map((value) => (value).toJson()).toList(); |
| 995 } | 1117 } |
| 996 if (metadata != null) { | 1118 if (metadata != null) { |
| 997 _json["metadata"] = metadata; | 1119 _json["metadata"] = metadata; |
| 998 } | 1120 } |
| 999 if (name != null) { | 1121 if (name != null) { |
| 1000 _json["name"] = name; | 1122 _json["name"] = name; |
| 1001 } | 1123 } |
| 1002 if (salience != null) { | 1124 if (salience != null) { |
| 1003 _json["salience"] = salience; | 1125 _json["salience"] = salience; |
| 1004 } | 1126 } |
| 1005 if (sentiment != null) { | 1127 if (sentiment != null) { |
| 1006 _json["sentiment"] = (sentiment).toJson(); | 1128 _json["sentiment"] = (sentiment).toJson(); |
| 1007 } | 1129 } |
| 1008 if (type != null) { | 1130 if (type != null) { |
| 1009 _json["type"] = type; | 1131 _json["type"] = type; |
| 1010 } | 1132 } |
| 1011 return _json; | 1133 return _json; |
| 1012 } | 1134 } |
| 1013 } | 1135 } |
| 1014 | 1136 |
| 1015 /** | 1137 /// Represents a mention for an entity in the text. Currently, proper noun |
| 1016 * Represents a mention for an entity in the text. Currently, proper noun | 1138 /// mentions are supported. |
| 1017 * mentions are supported. | |
| 1018 */ | |
| 1019 class EntityMention { | 1139 class EntityMention { |
| 1020 /** | 1140 /// For calls to AnalyzeEntitySentiment or if |
| 1021 * For calls to AnalyzeEntitySentiment or if | 1141 /// AnnotateTextRequest.Features.extract_entity_sentiment is set to |
| 1022 * AnnotateTextRequest.Features.extract_entity_sentiment is set to | 1142 /// true, this field will contain the sentiment expressed for this mention of |
| 1023 * true, this field will contain the sentiment expressed for this mention of | 1143 /// the entity in the provided document. |
| 1024 * the entity in the provided document. | |
| 1025 */ | |
| 1026 Sentiment sentiment; | 1144 Sentiment sentiment; |
| 1027 /** The mention text. */ | 1145 |
| 1146 /// The mention text. |
| 1028 TextSpan text; | 1147 TextSpan text; |
| 1029 /** | 1148 |
| 1030 * The type of the entity mention. | 1149 /// The type of the entity mention. |
| 1031 * Possible string values are: | 1150 /// Possible string values are: |
| 1032 * - "TYPE_UNKNOWN" : Unknown | 1151 /// - "TYPE_UNKNOWN" : Unknown |
| 1033 * - "PROPER" : Proper name | 1152 /// - "PROPER" : Proper name |
| 1034 * - "COMMON" : Common noun (or noun compound) | 1153 /// - "COMMON" : Common noun (or noun compound) |
| 1035 */ | |
| 1036 core.String type; | 1154 core.String type; |
| 1037 | 1155 |
| 1038 EntityMention(); | 1156 EntityMention(); |
| 1039 | 1157 |
| 1040 EntityMention.fromJson(core.Map _json) { | 1158 EntityMention.fromJson(core.Map _json) { |
| 1041 if (_json.containsKey("sentiment")) { | 1159 if (_json.containsKey("sentiment")) { |
| 1042 sentiment = new Sentiment.fromJson(_json["sentiment"]); | 1160 sentiment = new Sentiment.fromJson(_json["sentiment"]); |
| 1043 } | 1161 } |
| 1044 if (_json.containsKey("text")) { | 1162 if (_json.containsKey("text")) { |
| 1045 text = new TextSpan.fromJson(_json["text"]); | 1163 text = new TextSpan.fromJson(_json["text"]); |
| 1046 } | 1164 } |
| 1047 if (_json.containsKey("type")) { | 1165 if (_json.containsKey("type")) { |
| 1048 type = _json["type"]; | 1166 type = _json["type"]; |
| 1049 } | 1167 } |
| 1050 } | 1168 } |
| 1051 | 1169 |
| 1052 core.Map<core.String, core.Object> toJson() { | 1170 core.Map<core.String, core.Object> toJson() { |
| 1053 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1171 final core.Map<core.String, core.Object> _json = |
| 1172 new core.Map<core.String, core.Object>(); |
| 1054 if (sentiment != null) { | 1173 if (sentiment != null) { |
| 1055 _json["sentiment"] = (sentiment).toJson(); | 1174 _json["sentiment"] = (sentiment).toJson(); |
| 1056 } | 1175 } |
| 1057 if (text != null) { | 1176 if (text != null) { |
| 1058 _json["text"] = (text).toJson(); | 1177 _json["text"] = (text).toJson(); |
| 1059 } | 1178 } |
| 1060 if (type != null) { | 1179 if (type != null) { |
| 1061 _json["type"] = type; | 1180 _json["type"] = type; |
| 1062 } | 1181 } |
| 1063 return _json; | 1182 return _json; |
| 1064 } | 1183 } |
| 1065 } | 1184 } |
| 1066 | 1185 |
| 1067 /** | 1186 /// All available features for sentiment, syntax, and semantic analysis. |
| 1068 * All available features for sentiment, syntax, and semantic analysis. | 1187 /// Setting each one to true will enable that specific analysis for the input. |
| 1069 * Setting each one to true will enable that specific analysis for the input. | |
| 1070 */ | |
| 1071 class Features { | 1188 class Features { |
| 1072 /** Extract document-level sentiment. */ | 1189 /// Classify the full document into categories. |
| 1190 core.bool classifyText; |
| 1191 |
| 1192 /// Extract document-level sentiment. |
| 1073 core.bool extractDocumentSentiment; | 1193 core.bool extractDocumentSentiment; |
| 1074 /** Extract entities. */ | 1194 |
| 1195 /// Extract entities. |
| 1075 core.bool extractEntities; | 1196 core.bool extractEntities; |
| 1076 /** Extract entities and their associated sentiment. */ | 1197 |
| 1198 /// Extract entities and their associated sentiment. |
| 1077 core.bool extractEntitySentiment; | 1199 core.bool extractEntitySentiment; |
| 1078 /** Extract syntax information. */ | 1200 |
| 1201 /// Extract syntax information. |
| 1079 core.bool extractSyntax; | 1202 core.bool extractSyntax; |
| 1080 | 1203 |
| 1081 Features(); | 1204 Features(); |
| 1082 | 1205 |
| 1083 Features.fromJson(core.Map _json) { | 1206 Features.fromJson(core.Map _json) { |
| 1207 if (_json.containsKey("classifyText")) { |
| 1208 classifyText = _json["classifyText"]; |
| 1209 } |
| 1084 if (_json.containsKey("extractDocumentSentiment")) { | 1210 if (_json.containsKey("extractDocumentSentiment")) { |
| 1085 extractDocumentSentiment = _json["extractDocumentSentiment"]; | 1211 extractDocumentSentiment = _json["extractDocumentSentiment"]; |
| 1086 } | 1212 } |
| 1087 if (_json.containsKey("extractEntities")) { | 1213 if (_json.containsKey("extractEntities")) { |
| 1088 extractEntities = _json["extractEntities"]; | 1214 extractEntities = _json["extractEntities"]; |
| 1089 } | 1215 } |
| 1090 if (_json.containsKey("extractEntitySentiment")) { | 1216 if (_json.containsKey("extractEntitySentiment")) { |
| 1091 extractEntitySentiment = _json["extractEntitySentiment"]; | 1217 extractEntitySentiment = _json["extractEntitySentiment"]; |
| 1092 } | 1218 } |
| 1093 if (_json.containsKey("extractSyntax")) { | 1219 if (_json.containsKey("extractSyntax")) { |
| 1094 extractSyntax = _json["extractSyntax"]; | 1220 extractSyntax = _json["extractSyntax"]; |
| 1095 } | 1221 } |
| 1096 } | 1222 } |
| 1097 | 1223 |
| 1098 core.Map<core.String, core.Object> toJson() { | 1224 core.Map<core.String, core.Object> toJson() { |
| 1099 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1225 final core.Map<core.String, core.Object> _json = |
| 1226 new core.Map<core.String, core.Object>(); |
| 1227 if (classifyText != null) { |
| 1228 _json["classifyText"] = classifyText; |
| 1229 } |
| 1100 if (extractDocumentSentiment != null) { | 1230 if (extractDocumentSentiment != null) { |
| 1101 _json["extractDocumentSentiment"] = extractDocumentSentiment; | 1231 _json["extractDocumentSentiment"] = extractDocumentSentiment; |
| 1102 } | 1232 } |
| 1103 if (extractEntities != null) { | 1233 if (extractEntities != null) { |
| 1104 _json["extractEntities"] = extractEntities; | 1234 _json["extractEntities"] = extractEntities; |
| 1105 } | 1235 } |
| 1106 if (extractEntitySentiment != null) { | 1236 if (extractEntitySentiment != null) { |
| 1107 _json["extractEntitySentiment"] = extractEntitySentiment; | 1237 _json["extractEntitySentiment"] = extractEntitySentiment; |
| 1108 } | 1238 } |
| 1109 if (extractSyntax != null) { | 1239 if (extractSyntax != null) { |
| 1110 _json["extractSyntax"] = extractSyntax; | 1240 _json["extractSyntax"] = extractSyntax; |
| 1111 } | 1241 } |
| 1112 return _json; | 1242 return _json; |
| 1113 } | 1243 } |
| 1114 } | 1244 } |
| 1115 | 1245 |
| 1116 /** Represents part of speech information for a token. */ | 1246 /// Represents part of speech information for a token. |
| 1117 class PartOfSpeech { | 1247 class PartOfSpeech { |
| 1118 /** | 1248 /// The grammatical aspect. |
| 1119 * The grammatical aspect. | 1249 /// Possible string values are: |
| 1120 * Possible string values are: | 1250 /// - "ASPECT_UNKNOWN" : Aspect is not applicable in the analyzed language or |
| 1121 * - "ASPECT_UNKNOWN" : Aspect is not applicable in the analyzed language or | 1251 /// is not predicted. |
| 1122 * is not predicted. | 1252 /// - "PERFECTIVE" : Perfective |
| 1123 * - "PERFECTIVE" : Perfective | 1253 /// - "IMPERFECTIVE" : Imperfective |
| 1124 * - "IMPERFECTIVE" : Imperfective | 1254 /// - "PROGRESSIVE" : Progressive |
| 1125 * - "PROGRESSIVE" : Progressive | |
| 1126 */ | |
| 1127 core.String aspect; | 1255 core.String aspect; |
| 1128 /** | 1256 |
| 1129 * The grammatical case. | 1257 /// The grammatical case. |
| 1130 * Possible string values are: | 1258 /// Possible string values are: |
| 1131 * - "CASE_UNKNOWN" : Case is not applicable in the analyzed language or is | 1259 /// - "CASE_UNKNOWN" : Case is not applicable in the analyzed language or is |
| 1132 * not predicted. | 1260 /// not predicted. |
| 1133 * - "ACCUSATIVE" : Accusative | 1261 /// - "ACCUSATIVE" : Accusative |
| 1134 * - "ADVERBIAL" : Adverbial | 1262 /// - "ADVERBIAL" : Adverbial |
| 1135 * - "COMPLEMENTIVE" : Complementive | 1263 /// - "COMPLEMENTIVE" : Complementive |
| 1136 * - "DATIVE" : Dative | 1264 /// - "DATIVE" : Dative |
| 1137 * - "GENITIVE" : Genitive | 1265 /// - "GENITIVE" : Genitive |
| 1138 * - "INSTRUMENTAL" : Instrumental | 1266 /// - "INSTRUMENTAL" : Instrumental |
| 1139 * - "LOCATIVE" : Locative | 1267 /// - "LOCATIVE" : Locative |
| 1140 * - "NOMINATIVE" : Nominative | 1268 /// - "NOMINATIVE" : Nominative |
| 1141 * - "OBLIQUE" : Oblique | 1269 /// - "OBLIQUE" : Oblique |
| 1142 * - "PARTITIVE" : Partitive | 1270 /// - "PARTITIVE" : Partitive |
| 1143 * - "PREPOSITIONAL" : Prepositional | 1271 /// - "PREPOSITIONAL" : Prepositional |
| 1144 * - "REFLEXIVE_CASE" : Reflexive | 1272 /// - "REFLEXIVE_CASE" : Reflexive |
| 1145 * - "RELATIVE_CASE" : Relative | 1273 /// - "RELATIVE_CASE" : Relative |
| 1146 * - "VOCATIVE" : Vocative | 1274 /// - "VOCATIVE" : Vocative |
| 1147 */ | |
| 1148 core.String case_; | 1275 core.String case_; |
| 1149 /** | 1276 |
| 1150 * The grammatical form. | 1277 /// The grammatical form. |
| 1151 * Possible string values are: | 1278 /// Possible string values are: |
| 1152 * - "FORM_UNKNOWN" : Form is not applicable in the analyzed language or is | 1279 /// - "FORM_UNKNOWN" : Form is not applicable in the analyzed language or is |
| 1153 * not predicted. | 1280 /// not predicted. |
| 1154 * - "ADNOMIAL" : Adnomial | 1281 /// - "ADNOMIAL" : Adnomial |
| 1155 * - "AUXILIARY" : Auxiliary | 1282 /// - "AUXILIARY" : Auxiliary |
| 1156 * - "COMPLEMENTIZER" : Complementizer | 1283 /// - "COMPLEMENTIZER" : Complementizer |
| 1157 * - "FINAL_ENDING" : Final ending | 1284 /// - "FINAL_ENDING" : Final ending |
| 1158 * - "GERUND" : Gerund | 1285 /// - "GERUND" : Gerund |
| 1159 * - "REALIS" : Realis | 1286 /// - "REALIS" : Realis |
| 1160 * - "IRREALIS" : Irrealis | 1287 /// - "IRREALIS" : Irrealis |
| 1161 * - "SHORT" : Short form | 1288 /// - "SHORT" : Short form |
| 1162 * - "LONG" : Long form | 1289 /// - "LONG" : Long form |
| 1163 * - "ORDER" : Order form | 1290 /// - "ORDER" : Order form |
| 1164 * - "SPECIFIC" : Specific form | 1291 /// - "SPECIFIC" : Specific form |
| 1165 */ | |
| 1166 core.String form; | 1292 core.String form; |
| 1167 /** | 1293 |
| 1168 * The grammatical gender. | 1294 /// The grammatical gender. |
| 1169 * Possible string values are: | 1295 /// Possible string values are: |
| 1170 * - "GENDER_UNKNOWN" : Gender is not applicable in the analyzed language or | 1296 /// - "GENDER_UNKNOWN" : Gender is not applicable in the analyzed language or |
| 1171 * is not predicted. | 1297 /// is not predicted. |
| 1172 * - "FEMININE" : Feminine | 1298 /// - "FEMININE" : Feminine |
| 1173 * - "MASCULINE" : Masculine | 1299 /// - "MASCULINE" : Masculine |
| 1174 * - "NEUTER" : Neuter | 1300 /// - "NEUTER" : Neuter |
| 1175 */ | |
| 1176 core.String gender; | 1301 core.String gender; |
| 1177 /** | 1302 |
| 1178 * The grammatical mood. | 1303 /// The grammatical mood. |
| 1179 * Possible string values are: | 1304 /// Possible string values are: |
| 1180 * - "MOOD_UNKNOWN" : Mood is not applicable in the analyzed language or is | 1305 /// - "MOOD_UNKNOWN" : Mood is not applicable in the analyzed language or is |
| 1181 * not predicted. | 1306 /// not predicted. |
| 1182 * - "CONDITIONAL_MOOD" : Conditional | 1307 /// - "CONDITIONAL_MOOD" : Conditional |
| 1183 * - "IMPERATIVE" : Imperative | 1308 /// - "IMPERATIVE" : Imperative |
| 1184 * - "INDICATIVE" : Indicative | 1309 /// - "INDICATIVE" : Indicative |
| 1185 * - "INTERROGATIVE" : Interrogative | 1310 /// - "INTERROGATIVE" : Interrogative |
| 1186 * - "JUSSIVE" : Jussive | 1311 /// - "JUSSIVE" : Jussive |
| 1187 * - "SUBJUNCTIVE" : Subjunctive | 1312 /// - "SUBJUNCTIVE" : Subjunctive |
| 1188 */ | |
| 1189 core.String mood; | 1313 core.String mood; |
| 1190 /** | 1314 |
| 1191 * The grammatical number. | 1315 /// The grammatical number. |
| 1192 * Possible string values are: | 1316 /// Possible string values are: |
| 1193 * - "NUMBER_UNKNOWN" : Number is not applicable in the analyzed language or | 1317 /// - "NUMBER_UNKNOWN" : Number is not applicable in the analyzed language or |
| 1194 * is not predicted. | 1318 /// is not predicted. |
| 1195 * - "SINGULAR" : Singular | 1319 /// - "SINGULAR" : Singular |
| 1196 * - "PLURAL" : Plural | 1320 /// - "PLURAL" : Plural |
| 1197 * - "DUAL" : Dual | 1321 /// - "DUAL" : Dual |
| 1198 */ | |
| 1199 core.String number; | 1322 core.String number; |
| 1200 /** | 1323 |
| 1201 * The grammatical person. | 1324 /// The grammatical person. |
| 1202 * Possible string values are: | 1325 /// Possible string values are: |
| 1203 * - "PERSON_UNKNOWN" : Person is not applicable in the analyzed language or | 1326 /// - "PERSON_UNKNOWN" : Person is not applicable in the analyzed language or |
| 1204 * is not predicted. | 1327 /// is not predicted. |
| 1205 * - "FIRST" : First | 1328 /// - "FIRST" : First |
| 1206 * - "SECOND" : Second | 1329 /// - "SECOND" : Second |
| 1207 * - "THIRD" : Third | 1330 /// - "THIRD" : Third |
| 1208 * - "REFLEXIVE_PERSON" : Reflexive | 1331 /// - "REFLEXIVE_PERSON" : Reflexive |
| 1209 */ | |
| 1210 core.String person; | 1332 core.String person; |
| 1211 /** | 1333 |
| 1212 * The grammatical properness. | 1334 /// The grammatical properness. |
| 1213 * Possible string values are: | 1335 /// Possible string values are: |
| 1214 * - "PROPER_UNKNOWN" : Proper is not applicable in the analyzed language or | 1336 /// - "PROPER_UNKNOWN" : Proper is not applicable in the analyzed language or |
| 1215 * is not predicted. | 1337 /// is not predicted. |
| 1216 * - "PROPER" : Proper | 1338 /// - "PROPER" : Proper |
| 1217 * - "NOT_PROPER" : Not proper | 1339 /// - "NOT_PROPER" : Not proper |
| 1218 */ | |
| 1219 core.String proper; | 1340 core.String proper; |
| 1220 /** | 1341 |
| 1221 * The grammatical reciprocity. | 1342 /// The grammatical reciprocity. |
| 1222 * Possible string values are: | 1343 /// Possible string values are: |
| 1223 * - "RECIPROCITY_UNKNOWN" : Reciprocity is not applicable in the analyzed | 1344 /// - "RECIPROCITY_UNKNOWN" : Reciprocity is not applicable in the analyzed |
| 1224 * language or is not | 1345 /// language or is not |
| 1225 * predicted. | 1346 /// predicted. |
| 1226 * - "RECIPROCAL" : Reciprocal | 1347 /// - "RECIPROCAL" : Reciprocal |
| 1227 * - "NON_RECIPROCAL" : Non-reciprocal | 1348 /// - "NON_RECIPROCAL" : Non-reciprocal |
| 1228 */ | |
| 1229 core.String reciprocity; | 1349 core.String reciprocity; |
| 1230 /** | 1350 |
| 1231 * The part of speech tag. | 1351 /// The part of speech tag. |
| 1232 * Possible string values are: | 1352 /// Possible string values are: |
| 1233 * - "UNKNOWN" : Unknown | 1353 /// - "UNKNOWN" : Unknown |
| 1234 * - "ADJ" : Adjective | 1354 /// - "ADJ" : Adjective |
| 1235 * - "ADP" : Adposition (preposition and postposition) | 1355 /// - "ADP" : Adposition (preposition and postposition) |
| 1236 * - "ADV" : Adverb | 1356 /// - "ADV" : Adverb |
| 1237 * - "CONJ" : Conjunction | 1357 /// - "CONJ" : Conjunction |
| 1238 * - "DET" : Determiner | 1358 /// - "DET" : Determiner |
| 1239 * - "NOUN" : Noun (common and proper) | 1359 /// - "NOUN" : Noun (common and proper) |
| 1240 * - "NUM" : Cardinal number | 1360 /// - "NUM" : Cardinal number |
| 1241 * - "PRON" : Pronoun | 1361 /// - "PRON" : Pronoun |
| 1242 * - "PRT" : Particle or other function word | 1362 /// - "PRT" : Particle or other function word |
| 1243 * - "PUNCT" : Punctuation | 1363 /// - "PUNCT" : Punctuation |
| 1244 * - "VERB" : Verb (all tenses and modes) | 1364 /// - "VERB" : Verb (all tenses and modes) |
| 1245 * - "X" : Other: foreign words, typos, abbreviations | 1365 /// - "X" : Other: foreign words, typos, abbreviations |
| 1246 * - "AFFIX" : Affix | 1366 /// - "AFFIX" : Affix |
| 1247 */ | |
| 1248 core.String tag; | 1367 core.String tag; |
| 1249 /** | 1368 |
| 1250 * The grammatical tense. | 1369 /// The grammatical tense. |
| 1251 * Possible string values are: | 1370 /// Possible string values are: |
| 1252 * - "TENSE_UNKNOWN" : Tense is not applicable in the analyzed language or is | 1371 /// - "TENSE_UNKNOWN" : Tense is not applicable in the analyzed language or |
| 1253 * not predicted. | 1372 /// is not predicted. |
| 1254 * - "CONDITIONAL_TENSE" : Conditional | 1373 /// - "CONDITIONAL_TENSE" : Conditional |
| 1255 * - "FUTURE" : Future | 1374 /// - "FUTURE" : Future |
| 1256 * - "PAST" : Past | 1375 /// - "PAST" : Past |
| 1257 * - "PRESENT" : Present | 1376 /// - "PRESENT" : Present |
| 1258 * - "IMPERFECT" : Imperfect | 1377 /// - "IMPERFECT" : Imperfect |
| 1259 * - "PLUPERFECT" : Pluperfect | 1378 /// - "PLUPERFECT" : Pluperfect |
| 1260 */ | |
| 1261 core.String tense; | 1379 core.String tense; |
| 1262 /** | 1380 |
| 1263 * The grammatical voice. | 1381 /// The grammatical voice. |
| 1264 * Possible string values are: | 1382 /// Possible string values are: |
| 1265 * - "VOICE_UNKNOWN" : Voice is not applicable in the analyzed language or is | 1383 /// - "VOICE_UNKNOWN" : Voice is not applicable in the analyzed language or |
| 1266 * not predicted. | 1384 /// is not predicted. |
| 1267 * - "ACTIVE" : Active | 1385 /// - "ACTIVE" : Active |
| 1268 * - "CAUSATIVE" : Causative | 1386 /// - "CAUSATIVE" : Causative |
| 1269 * - "PASSIVE" : Passive | 1387 /// - "PASSIVE" : Passive |
| 1270 */ | |
| 1271 core.String voice; | 1388 core.String voice; |
| 1272 | 1389 |
| 1273 PartOfSpeech(); | 1390 PartOfSpeech(); |
| 1274 | 1391 |
| 1275 PartOfSpeech.fromJson(core.Map _json) { | 1392 PartOfSpeech.fromJson(core.Map _json) { |
| 1276 if (_json.containsKey("aspect")) { | 1393 if (_json.containsKey("aspect")) { |
| 1277 aspect = _json["aspect"]; | 1394 aspect = _json["aspect"]; |
| 1278 } | 1395 } |
| 1279 if (_json.containsKey("case")) { | 1396 if (_json.containsKey("case")) { |
| 1280 case_ = _json["case"]; | 1397 case_ = _json["case"]; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 1305 } | 1422 } |
| 1306 if (_json.containsKey("tense")) { | 1423 if (_json.containsKey("tense")) { |
| 1307 tense = _json["tense"]; | 1424 tense = _json["tense"]; |
| 1308 } | 1425 } |
| 1309 if (_json.containsKey("voice")) { | 1426 if (_json.containsKey("voice")) { |
| 1310 voice = _json["voice"]; | 1427 voice = _json["voice"]; |
| 1311 } | 1428 } |
| 1312 } | 1429 } |
| 1313 | 1430 |
| 1314 core.Map<core.String, core.Object> toJson() { | 1431 core.Map<core.String, core.Object> toJson() { |
| 1315 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1432 final core.Map<core.String, core.Object> _json = |
| 1433 new core.Map<core.String, core.Object>(); |
| 1316 if (aspect != null) { | 1434 if (aspect != null) { |
| 1317 _json["aspect"] = aspect; | 1435 _json["aspect"] = aspect; |
| 1318 } | 1436 } |
| 1319 if (case_ != null) { | 1437 if (case_ != null) { |
| 1320 _json["case"] = case_; | 1438 _json["case"] = case_; |
| 1321 } | 1439 } |
| 1322 if (form != null) { | 1440 if (form != null) { |
| 1323 _json["form"] = form; | 1441 _json["form"] = form; |
| 1324 } | 1442 } |
| 1325 if (gender != null) { | 1443 if (gender != null) { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 1346 if (tense != null) { | 1464 if (tense != null) { |
| 1347 _json["tense"] = tense; | 1465 _json["tense"] = tense; |
| 1348 } | 1466 } |
| 1349 if (voice != null) { | 1467 if (voice != null) { |
| 1350 _json["voice"] = voice; | 1468 _json["voice"] = voice; |
| 1351 } | 1469 } |
| 1352 return _json; | 1470 return _json; |
| 1353 } | 1471 } |
| 1354 } | 1472 } |
| 1355 | 1473 |
| 1356 /** Represents a sentence in the input document. */ | 1474 /// Represents a sentence in the input document. |
| 1357 class Sentence { | 1475 class Sentence { |
| 1358 /** | 1476 /// For calls to AnalyzeSentiment or if |
| 1359 * For calls to AnalyzeSentiment or if | 1477 /// AnnotateTextRequest.Features.extract_document_sentiment is set to |
| 1360 * AnnotateTextRequest.Features.extract_document_sentiment is set to | 1478 /// true, this field will contain the sentiment for the sentence. |
| 1361 * true, this field will contain the sentiment for the sentence. | |
| 1362 */ | |
| 1363 Sentiment sentiment; | 1479 Sentiment sentiment; |
| 1364 /** The sentence text. */ | 1480 |
| 1481 /// The sentence text. |
| 1365 TextSpan text; | 1482 TextSpan text; |
| 1366 | 1483 |
| 1367 Sentence(); | 1484 Sentence(); |
| 1368 | 1485 |
| 1369 Sentence.fromJson(core.Map _json) { | 1486 Sentence.fromJson(core.Map _json) { |
| 1370 if (_json.containsKey("sentiment")) { | 1487 if (_json.containsKey("sentiment")) { |
| 1371 sentiment = new Sentiment.fromJson(_json["sentiment"]); | 1488 sentiment = new Sentiment.fromJson(_json["sentiment"]); |
| 1372 } | 1489 } |
| 1373 if (_json.containsKey("text")) { | 1490 if (_json.containsKey("text")) { |
| 1374 text = new TextSpan.fromJson(_json["text"]); | 1491 text = new TextSpan.fromJson(_json["text"]); |
| 1375 } | 1492 } |
| 1376 } | 1493 } |
| 1377 | 1494 |
| 1378 core.Map<core.String, core.Object> toJson() { | 1495 core.Map<core.String, core.Object> toJson() { |
| 1379 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1496 final core.Map<core.String, core.Object> _json = |
| 1497 new core.Map<core.String, core.Object>(); |
| 1380 if (sentiment != null) { | 1498 if (sentiment != null) { |
| 1381 _json["sentiment"] = (sentiment).toJson(); | 1499 _json["sentiment"] = (sentiment).toJson(); |
| 1382 } | 1500 } |
| 1383 if (text != null) { | 1501 if (text != null) { |
| 1384 _json["text"] = (text).toJson(); | 1502 _json["text"] = (text).toJson(); |
| 1385 } | 1503 } |
| 1386 return _json; | 1504 return _json; |
| 1387 } | 1505 } |
| 1388 } | 1506 } |
| 1389 | 1507 |
| 1390 /** | 1508 /// Represents the feeling associated with the entire text or entities in |
| 1391 * Represents the feeling associated with the entire text or entities in | 1509 /// the text. |
| 1392 * the text. | |
| 1393 */ | |
| 1394 class Sentiment { | 1510 class Sentiment { |
| 1395 /** | 1511 /// A non-negative number in the [0, +inf) range, which represents |
| 1396 * A non-negative number in the [0, +inf) range, which represents | 1512 /// the absolute magnitude of sentiment regardless of score (positive or |
| 1397 * the absolute magnitude of sentiment regardless of score (positive or | 1513 /// negative). |
| 1398 * negative). | |
| 1399 */ | |
| 1400 core.double magnitude; | 1514 core.double magnitude; |
| 1401 /** | 1515 |
| 1402 * Sentiment score between -1.0 (negative sentiment) and 1.0 | 1516 /// Sentiment score between -1.0 (negative sentiment) and 1.0 |
| 1403 * (positive sentiment). | 1517 /// (positive sentiment). |
| 1404 */ | |
| 1405 core.double score; | 1518 core.double score; |
| 1406 | 1519 |
| 1407 Sentiment(); | 1520 Sentiment(); |
| 1408 | 1521 |
| 1409 Sentiment.fromJson(core.Map _json) { | 1522 Sentiment.fromJson(core.Map _json) { |
| 1410 if (_json.containsKey("magnitude")) { | 1523 if (_json.containsKey("magnitude")) { |
| 1411 magnitude = _json["magnitude"]; | 1524 magnitude = _json["magnitude"]; |
| 1412 } | 1525 } |
| 1413 if (_json.containsKey("score")) { | 1526 if (_json.containsKey("score")) { |
| 1414 score = _json["score"]; | 1527 score = _json["score"]; |
| 1415 } | 1528 } |
| 1416 } | 1529 } |
| 1417 | 1530 |
| 1418 core.Map<core.String, core.Object> toJson() { | 1531 core.Map<core.String, core.Object> toJson() { |
| 1419 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1532 final core.Map<core.String, core.Object> _json = |
| 1533 new core.Map<core.String, core.Object>(); |
| 1420 if (magnitude != null) { | 1534 if (magnitude != null) { |
| 1421 _json["magnitude"] = magnitude; | 1535 _json["magnitude"] = magnitude; |
| 1422 } | 1536 } |
| 1423 if (score != null) { | 1537 if (score != null) { |
| 1424 _json["score"] = score; | 1538 _json["score"] = score; |
| 1425 } | 1539 } |
| 1426 return _json; | 1540 return _json; |
| 1427 } | 1541 } |
| 1428 } | 1542 } |
| 1429 | 1543 |
| 1430 /** | 1544 /// The `Status` type defines a logical error model that is suitable for |
| 1431 * The `Status` type defines a logical error model that is suitable for | 1545 /// different |
| 1432 * different | 1546 /// programming environments, including REST APIs and RPC APIs. It is used by |
| 1433 * programming environments, including REST APIs and RPC APIs. It is used by | 1547 /// [gRPC](https://github.com/grpc). The error model is designed to be: |
| 1434 * [gRPC](https://github.com/grpc). The error model is designed to be: | 1548 /// |
| 1435 * | 1549 /// - Simple to use and understand for most users |
| 1436 * - Simple to use and understand for most users | 1550 /// - Flexible enough to meet unexpected needs |
| 1437 * - Flexible enough to meet unexpected needs | 1551 /// |
| 1438 * | 1552 /// # Overview |
| 1439 * # Overview | 1553 /// |
| 1440 * | 1554 /// The `Status` message contains three pieces of data: error code, error |
| 1441 * The `Status` message contains three pieces of data: error code, error | 1555 /// message, |
| 1442 * message, | 1556 /// and error details. The error code should be an enum value of |
| 1443 * and error details. The error code should be an enum value of | 1557 /// google.rpc.Code, but it may accept additional error codes if needed. The |
| 1444 * google.rpc.Code, but it may accept additional error codes if needed. The | 1558 /// error message should be a developer-facing English message that helps |
| 1445 * error message should be a developer-facing English message that helps | 1559 /// developers *understand* and *resolve* the error. If a localized user-facing |
| 1446 * developers *understand* and *resolve* the error. If a localized user-facing | 1560 /// error message is needed, put the localized message in the error details or |
| 1447 * error message is needed, put the localized message in the error details or | 1561 /// localize it in the client. The optional error details may contain arbitrary |
| 1448 * localize it in the client. The optional error details may contain arbitrary | 1562 /// information about the error. There is a predefined set of error detail |
| 1449 * information about the error. There is a predefined set of error detail types | 1563 /// types |
| 1450 * in the package `google.rpc` that can be used for common error conditions. | 1564 /// in the package `google.rpc` that can be used for common error conditions. |
| 1451 * | 1565 /// |
| 1452 * # Language mapping | 1566 /// # Language mapping |
| 1453 * | 1567 /// |
| 1454 * The `Status` message is the logical representation of the error model, but it | 1568 /// The `Status` message is the logical representation of the error model, but |
| 1455 * is not necessarily the actual wire format. When the `Status` message is | 1569 /// it |
| 1456 * exposed in different client libraries and different wire protocols, it can be | 1570 /// is not necessarily the actual wire format. When the `Status` message is |
| 1457 * mapped differently. For example, it will likely be mapped to some exceptions | 1571 /// exposed in different client libraries and different wire protocols, it can |
| 1458 * in Java, but more likely mapped to some error codes in C. | 1572 /// be |
| 1459 * | 1573 /// mapped differently. For example, it will likely be mapped to some |
| 1460 * # Other uses | 1574 /// exceptions |
| 1461 * | 1575 /// in Java, but more likely mapped to some error codes in C. |
| 1462 * The error model and the `Status` message can be used in a variety of | 1576 /// |
| 1463 * environments, either with or without APIs, to provide a | 1577 /// # Other uses |
| 1464 * consistent developer experience across different environments. | 1578 /// |
| 1465 * | 1579 /// The error model and the `Status` message can be used in a variety of |
| 1466 * Example uses of this error model include: | 1580 /// environments, either with or without APIs, to provide a |
| 1467 * | 1581 /// consistent developer experience across different environments. |
| 1468 * - Partial errors. If a service needs to return partial errors to the client, | 1582 /// |
| 1469 * it may embed the `Status` in the normal response to indicate the partial | 1583 /// Example uses of this error model include: |
| 1470 * errors. | 1584 /// |
| 1471 * | 1585 /// - Partial errors. If a service needs to return partial errors to the |
| 1472 * - Workflow errors. A typical workflow has multiple steps. Each step may | 1586 /// client, |
| 1473 * have a `Status` message for error reporting. | 1587 /// it may embed the `Status` in the normal response to indicate the partial |
| 1474 * | 1588 /// errors. |
| 1475 * - Batch operations. If a client uses batch request and batch response, the | 1589 /// |
| 1476 * `Status` message should be used directly inside batch response, one for | 1590 /// - Workflow errors. A typical workflow has multiple steps. Each step may |
| 1477 * each error sub-response. | 1591 /// have a `Status` message for error reporting. |
| 1478 * | 1592 /// |
| 1479 * - Asynchronous operations. If an API call embeds asynchronous operation | 1593 /// - Batch operations. If a client uses batch request and batch response, the |
| 1480 * results in its response, the status of those operations should be | 1594 /// `Status` message should be used directly inside batch response, one for |
| 1481 * represented directly using the `Status` message. | 1595 /// each error sub-response. |
| 1482 * | 1596 /// |
| 1483 * - Logging. If some API errors are stored in logs, the message `Status` could | 1597 /// - Asynchronous operations. If an API call embeds asynchronous operation |
| 1484 * be used directly after any stripping needed for security/privacy reasons. | 1598 /// results in its response, the status of those operations should be |
| 1485 */ | 1599 /// represented directly using the `Status` message. |
| 1600 /// |
| 1601 /// - Logging. If some API errors are stored in logs, the message `Status` |
| 1602 /// could |
| 1603 /// be used directly after any stripping needed for security/privacy reasons. |
| 1486 class Status { | 1604 class Status { |
| 1487 /** The status code, which should be an enum value of google.rpc.Code. */ | 1605 /// The status code, which should be an enum value of google.rpc.Code. |
| 1488 core.int code; | 1606 core.int code; |
| 1489 /** | 1607 |
| 1490 * A list of messages that carry the error details. There is a common set of | 1608 /// A list of messages that carry the error details. There is a common set |
| 1491 * message types for APIs to use. | 1609 /// of |
| 1492 * | 1610 /// message types for APIs to use. |
| 1493 * The values for Object must be JSON objects. It can consist of `num`, | 1611 /// |
| 1494 * `String`, `bool` and `null` as well as `Map` and `List` values. | 1612 /// The values for Object must be JSON objects. It can consist of `num`, |
| 1495 */ | 1613 /// `String`, `bool` and `null` as well as `Map` and `List` values. |
| 1496 core.List<core.Map<core.String, core.Object>> details; | 1614 core.List<core.Map<core.String, core.Object>> details; |
| 1497 /** | 1615 |
| 1498 * A developer-facing error message, which should be in English. Any | 1616 /// A developer-facing error message, which should be in English. Any |
| 1499 * user-facing error message should be localized and sent in the | 1617 /// user-facing error message should be localized and sent in the |
| 1500 * google.rpc.Status.details field, or localized by the client. | 1618 /// google.rpc.Status.details field, or localized by the client. |
| 1501 */ | |
| 1502 core.String message; | 1619 core.String message; |
| 1503 | 1620 |
| 1504 Status(); | 1621 Status(); |
| 1505 | 1622 |
| 1506 Status.fromJson(core.Map _json) { | 1623 Status.fromJson(core.Map _json) { |
| 1507 if (_json.containsKey("code")) { | 1624 if (_json.containsKey("code")) { |
| 1508 code = _json["code"]; | 1625 code = _json["code"]; |
| 1509 } | 1626 } |
| 1510 if (_json.containsKey("details")) { | 1627 if (_json.containsKey("details")) { |
| 1511 details = _json["details"]; | 1628 details = _json["details"]; |
| 1512 } | 1629 } |
| 1513 if (_json.containsKey("message")) { | 1630 if (_json.containsKey("message")) { |
| 1514 message = _json["message"]; | 1631 message = _json["message"]; |
| 1515 } | 1632 } |
| 1516 } | 1633 } |
| 1517 | 1634 |
| 1518 core.Map<core.String, core.Object> toJson() { | 1635 core.Map<core.String, core.Object> toJson() { |
| 1519 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1636 final core.Map<core.String, core.Object> _json = |
| 1637 new core.Map<core.String, core.Object>(); |
| 1520 if (code != null) { | 1638 if (code != null) { |
| 1521 _json["code"] = code; | 1639 _json["code"] = code; |
| 1522 } | 1640 } |
| 1523 if (details != null) { | 1641 if (details != null) { |
| 1524 _json["details"] = details; | 1642 _json["details"] = details; |
| 1525 } | 1643 } |
| 1526 if (message != null) { | 1644 if (message != null) { |
| 1527 _json["message"] = message; | 1645 _json["message"] = message; |
| 1528 } | 1646 } |
| 1529 return _json; | 1647 return _json; |
| 1530 } | 1648 } |
| 1531 } | 1649 } |
| 1532 | 1650 |
| 1533 /** Represents an output piece of text. */ | 1651 /// Represents an output piece of text. |
| 1534 class TextSpan { | 1652 class TextSpan { |
| 1535 /** | 1653 /// The API calculates the beginning offset of the content in the original |
| 1536 * The API calculates the beginning offset of the content in the original | 1654 /// document according to the EncodingType specified in the API request. |
| 1537 * document according to the EncodingType specified in the API request. | |
| 1538 */ | |
| 1539 core.int beginOffset; | 1655 core.int beginOffset; |
| 1540 /** The content of the output text. */ | 1656 |
| 1657 /// The content of the output text. |
| 1541 core.String content; | 1658 core.String content; |
| 1542 | 1659 |
| 1543 TextSpan(); | 1660 TextSpan(); |
| 1544 | 1661 |
| 1545 TextSpan.fromJson(core.Map _json) { | 1662 TextSpan.fromJson(core.Map _json) { |
| 1546 if (_json.containsKey("beginOffset")) { | 1663 if (_json.containsKey("beginOffset")) { |
| 1547 beginOffset = _json["beginOffset"]; | 1664 beginOffset = _json["beginOffset"]; |
| 1548 } | 1665 } |
| 1549 if (_json.containsKey("content")) { | 1666 if (_json.containsKey("content")) { |
| 1550 content = _json["content"]; | 1667 content = _json["content"]; |
| 1551 } | 1668 } |
| 1552 } | 1669 } |
| 1553 | 1670 |
| 1554 core.Map<core.String, core.Object> toJson() { | 1671 core.Map<core.String, core.Object> toJson() { |
| 1555 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1672 final core.Map<core.String, core.Object> _json = |
| 1673 new core.Map<core.String, core.Object>(); |
| 1556 if (beginOffset != null) { | 1674 if (beginOffset != null) { |
| 1557 _json["beginOffset"] = beginOffset; | 1675 _json["beginOffset"] = beginOffset; |
| 1558 } | 1676 } |
| 1559 if (content != null) { | 1677 if (content != null) { |
| 1560 _json["content"] = content; | 1678 _json["content"] = content; |
| 1561 } | 1679 } |
| 1562 return _json; | 1680 return _json; |
| 1563 } | 1681 } |
| 1564 } | 1682 } |
| 1565 | 1683 |
| 1566 /** Represents the smallest syntactic building block of the text. */ | 1684 /// Represents the smallest syntactic building block of the text. |
| 1567 class Token { | 1685 class Token { |
| 1568 /** Dependency tree parse for this token. */ | 1686 /// Dependency tree parse for this token. |
| 1569 DependencyEdge dependencyEdge; | 1687 DependencyEdge dependencyEdge; |
| 1570 /** | 1688 |
| 1571 * [Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the token. | 1689 /// [Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the |
| 1572 */ | 1690 /// token. |
| 1573 core.String lemma; | 1691 core.String lemma; |
| 1574 /** Parts of speech tag for this token. */ | 1692 |
| 1693 /// Parts of speech tag for this token. |
| 1575 PartOfSpeech partOfSpeech; | 1694 PartOfSpeech partOfSpeech; |
| 1576 /** The token text. */ | 1695 |
| 1696 /// The token text. |
| 1577 TextSpan text; | 1697 TextSpan text; |
| 1578 | 1698 |
| 1579 Token(); | 1699 Token(); |
| 1580 | 1700 |
| 1581 Token.fromJson(core.Map _json) { | 1701 Token.fromJson(core.Map _json) { |
| 1582 if (_json.containsKey("dependencyEdge")) { | 1702 if (_json.containsKey("dependencyEdge")) { |
| 1583 dependencyEdge = new DependencyEdge.fromJson(_json["dependencyEdge"]); | 1703 dependencyEdge = new DependencyEdge.fromJson(_json["dependencyEdge"]); |
| 1584 } | 1704 } |
| 1585 if (_json.containsKey("lemma")) { | 1705 if (_json.containsKey("lemma")) { |
| 1586 lemma = _json["lemma"]; | 1706 lemma = _json["lemma"]; |
| 1587 } | 1707 } |
| 1588 if (_json.containsKey("partOfSpeech")) { | 1708 if (_json.containsKey("partOfSpeech")) { |
| 1589 partOfSpeech = new PartOfSpeech.fromJson(_json["partOfSpeech"]); | 1709 partOfSpeech = new PartOfSpeech.fromJson(_json["partOfSpeech"]); |
| 1590 } | 1710 } |
| 1591 if (_json.containsKey("text")) { | 1711 if (_json.containsKey("text")) { |
| 1592 text = new TextSpan.fromJson(_json["text"]); | 1712 text = new TextSpan.fromJson(_json["text"]); |
| 1593 } | 1713 } |
| 1594 } | 1714 } |
| 1595 | 1715 |
| 1596 core.Map<core.String, core.Object> toJson() { | 1716 core.Map<core.String, core.Object> toJson() { |
| 1597 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1717 final core.Map<core.String, core.Object> _json = |
| 1718 new core.Map<core.String, core.Object>(); |
| 1598 if (dependencyEdge != null) { | 1719 if (dependencyEdge != null) { |
| 1599 _json["dependencyEdge"] = (dependencyEdge).toJson(); | 1720 _json["dependencyEdge"] = (dependencyEdge).toJson(); |
| 1600 } | 1721 } |
| 1601 if (lemma != null) { | 1722 if (lemma != null) { |
| 1602 _json["lemma"] = lemma; | 1723 _json["lemma"] = lemma; |
| 1603 } | 1724 } |
| 1604 if (partOfSpeech != null) { | 1725 if (partOfSpeech != null) { |
| 1605 _json["partOfSpeech"] = (partOfSpeech).toJson(); | 1726 _json["partOfSpeech"] = (partOfSpeech).toJson(); |
| 1606 } | 1727 } |
| 1607 if (text != null) { | 1728 if (text != null) { |
| 1608 _json["text"] = (text).toJson(); | 1729 _json["text"] = (text).toJson(); |
| 1609 } | 1730 } |
| 1610 return _json; | 1731 return _json; |
| 1611 } | 1732 } |
| 1612 } | 1733 } |
| OLD | NEW |