@@ -93,11 +93,12 @@ util.inherits(Language, common.GrpcService);
9393 * detection, this may be more convenient. However, if you plan to run multiple
9494 * detections, it's easier to create a {module:language/document} object.
9595 *
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 }
9797 *
9898 * @param {string|module:storage/file } content - Inline content or a Storage
9999 * 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).
101102 * @param {string } options.encoding - `UTF8`, `UTF16`, or `UTF32`. See
102103 * [`EncodingType`](https://cloud.google.com/natural-language/reference/rest/v1beta1/EncodingType).
103104 * @param {string } options.language - The language of the text.
@@ -136,6 +137,16 @@ util.inherits(Language, common.GrpcService);
136137 * language.annotate('Hello!', options, callback);
137138 *
138139 * //-
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+ * //-
139150 * // Verbose mode may also be enabled for more detailed results.
140151 * //-
141152 * var options = {
@@ -170,7 +181,8 @@ Language.prototype.annotate = function(content, options, callback) {
170181 *
171182 * @param {string|module:storage/file } content - Inline content or a Storage
172183 * 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).
174186 * @param {string } options.encoding - `UTF8`, `UTF16`, or `UTF32`. See
175187 * [`EncodingType`](https://cloud.google.com/natural-language/reference/rest/v1beta1/EncodingType).
176188 * @param {string } options.language - The language of the text.
@@ -209,6 +221,15 @@ Language.prototype.annotate = function(content, options, callback) {
209221 * language.detectEntities('Axel Foley is from Detroit', options, callback);
210222 *
211223 * //-
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+ * //-
212233 * // Verbose mode may also be enabled for more detailed results.
213234 * //-
214235 * var options = {
@@ -243,7 +264,8 @@ Language.prototype.detectEntities = function(content, options, callback) {
243264 *
244265 * @param {string|module:storage/file } content - Inline content or a Storage
245266 * 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).
247269 * @param {string } options.encoding - `UTF8`, `UTF16`, or `UTF32`. See
248270 * [`EncodingType`](https://cloud.google.com/natural-language/reference/rest/v1beta1/EncodingType).
249271 * @param {string } options.language - The language of the text.
@@ -337,6 +359,14 @@ Language.prototype.detectSentiment = function(content, options, callback) {
337359 * var document = language.document(file);
338360 *
339361 * //-
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+ * //-
340370 * // You can now run detections on the document.
341371 * //
342372 * // See {module:language/document} for a complete list of methods available.
@@ -374,6 +404,14 @@ Language.prototype.document = function(config) {
374404 * var document = language.html(file);
375405 *
376406 * //-
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+ * //-
377415 * // You can now run detections on the document.
378416 * //
379417 * // See {module:language/document} for a complete list of methods available.
@@ -416,6 +454,14 @@ Language.prototype.html = function(content, options) {
416454 * var document = language.text(file);
417455 *
418456 * //-
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+ * //-
419465 * // You can now run detections on the document.
420466 * //
421467 * // See {module:language/document} for a complete list of methods available.
0 commit comments