@@ -93,11 +93,12 @@ util.inherits(Language, common.GrpcService);
93
93
* detection, this may be more convenient. However, if you plan to run multiple
94
94
* detections, it's easier to create a {module:language/document} object.
95
95
*
96
- * @resource [documents.annotate API Documentation]{@link https://cloud.google.com/natural-language/reference/rest/v1beta1/documents/annotate }
96
+ * @resource [documents.annotate API Documentation]{@link https://cloud.google.com/natural-language/reference/rest/v1beta1/documents/annotateText }
97
97
*
98
98
* @param {string|module:storage/file } content - Inline content or a Storage
99
99
* File object.
100
- * @param {object= } options - Configuration object.
100
+ * @param {object= } options - Configuration object. See
101
+ * [documents.annotateText](https://cloud.google.com/natural-language/reference/rest/v1beta1/documents/annotateText#request-body).
101
102
* @param {string } options.encoding - `UTF8`, `UTF16`, or `UTF32`. See
102
103
* [`EncodingType`](https://cloud.google.com/natural-language/reference/rest/v1beta1/EncodingType).
103
104
* @param {string } options.language - The language of the text.
@@ -136,6 +137,16 @@ util.inherits(Language, common.GrpcService);
136
137
* language.annotate('Hello!', options, callback);
137
138
*
138
139
* //-
140
+ * // Specify the language the text is written in.
141
+ * //-
142
+ * var options = {
143
+ * language: 'es',
144
+ * entities: true
145
+ * };
146
+ *
147
+ * language.annotate('¿Dónde está la sede de Google?', options, callback);
148
+ *
149
+ * //-
139
150
* // Verbose mode may also be enabled for more detailed results.
140
151
* //-
141
152
* var options = {
@@ -170,7 +181,8 @@ Language.prototype.annotate = function(content, options, callback) {
170
181
*
171
182
* @param {string|module:storage/file } content - Inline content or a Storage
172
183
* File object.
173
- * @param {object= } options - Configuration object.
184
+ * @param {object= } options - Configuration object. See
185
+ * [documents.annotateText](https://cloud.google.com/natural-language/reference/rest/v1beta1/documents/analyzeEntities#request-body).
174
186
* @param {string } options.encoding - `UTF8`, `UTF16`, or `UTF32`. See
175
187
* [`EncodingType`](https://cloud.google.com/natural-language/reference/rest/v1beta1/EncodingType).
176
188
* @param {string } options.language - The language of the text.
@@ -209,6 +221,15 @@ Language.prototype.annotate = function(content, options, callback) {
209
221
* language.detectEntities('Axel Foley is from Detroit', options, callback);
210
222
*
211
223
* //-
224
+ * // Specify the language the text is written in.
225
+ * //-
226
+ * var options = {
227
+ * language: 'es'
228
+ * };
229
+ *
230
+ * language.detectEntities('Axel Foley es de Detroit', options, callback);
231
+ *
232
+ * //-
212
233
* // Verbose mode may also be enabled for more detailed results.
213
234
* //-
214
235
* var options = {
@@ -243,7 +264,8 @@ Language.prototype.detectEntities = function(content, options, callback) {
243
264
*
244
265
* @param {string|module:storage/file } content - Inline content or a Storage
245
266
* File object.
246
- * @param {object= } options - Configuration object.
267
+ * @param {object= } options - Configuration object. See
268
+ * [documents.annotateText](https://cloud.google.com/natural-language/reference/rest/v1beta1/documents/analyzeSentiment#request-body).
247
269
* @param {string } options.encoding - `UTF8`, `UTF16`, or `UTF32`. See
248
270
* [`EncodingType`](https://cloud.google.com/natural-language/reference/rest/v1beta1/EncodingType).
249
271
* @param {string } options.language - The language of the text.
@@ -337,6 +359,14 @@ Language.prototype.detectSentiment = function(content, options, callback) {
337
359
* var document = language.document(file);
338
360
*
339
361
* //-
362
+ * // Create a Document object with pre-defined configuration, such as its
363
+ * // language.
364
+ * //-
365
+ * var document = language.document('¿Dónde está la sede de Google?', {
366
+ * language: 'es'
367
+ * });
368
+ *
369
+ * //-
340
370
* // You can now run detections on the document.
341
371
* //
342
372
* // See {module:language/document} for a complete list of methods available.
@@ -374,6 +404,14 @@ Language.prototype.document = function(config) {
374
404
* var document = language.html(file);
375
405
*
376
406
* //-
407
+ * // Create a Document object with pre-defined configuration, such as its
408
+ * // language.
409
+ * //-
410
+ * var document = language.html('<h1>Titulo del documento</h1>', {
411
+ * language: 'es'
412
+ * });
413
+ *
414
+ * //-
377
415
* // You can now run detections on the document.
378
416
* //
379
417
* // See {module:language/document} for a complete list of methods available.
@@ -416,6 +454,14 @@ Language.prototype.html = function(content, options) {
416
454
* var document = language.text(file);
417
455
*
418
456
* //-
457
+ * // Create a Document object with pre-defined configuration, such as its
458
+ * // language.
459
+ * //-
460
+ * var document = language.text('¿Dónde está la sede de Google?', {
461
+ * language: 'es'
462
+ * });
463
+ *
464
+ * //-
419
465
* // You can now run detections on the document.
420
466
* //
421
467
* // See {module:language/document} for a complete list of methods available.
0 commit comments