@google-cloud/language
Advanced tools
Comparing version 0.4.0 to 0.5.0
{ | ||
"name": "@google-cloud/language", | ||
"version": "0.4.0", | ||
"version": "0.5.0", | ||
"author": "Google Inc.", | ||
@@ -58,3 +58,3 @@ "description": "Google Cloud Natural Language Client Library for Node.js", | ||
"extend": "^3.0.0", | ||
"google-gax": "^0.7.0", | ||
"google-gax": "^0.8.0", | ||
"google-proto-files": "^0.8.3", | ||
@@ -61,0 +61,0 @@ "is": "^3.0.1", |
@@ -398,6 +398,7 @@ /*! | ||
var doc = this.document; | ||
var encType = this.encodingType; | ||
this.api.Language.annotateText(doc, features, encType, function(err, resp) { | ||
this.api.Language.annotateText({ | ||
document: this.document, | ||
features: features, | ||
encodingType: this.encodingType | ||
}, function(err, resp) { | ||
if (err) { | ||
@@ -551,6 +552,6 @@ callback(err, null, resp); | ||
var doc = this.document; | ||
var encType = this.encodingType; | ||
this.api.Language.analyzeEntities(doc, encType, function(err, resp) { | ||
this.api.Language.analyzeEntities({ | ||
document: this.document, | ||
encodingType: this.encodingType | ||
}, function(err, resp) { | ||
if (err) { | ||
@@ -626,6 +627,6 @@ callback(err, null, resp); | ||
var doc = this.document; | ||
var encType = this.encodingType; | ||
this.api.Language.analyzeSentiment(doc, encType, function(err, resp) { | ||
this.api.Language.analyzeSentiment({ | ||
document: this.document, | ||
encodingType: this.encodingType | ||
}, function(err, resp) { | ||
if (err) { | ||
@@ -632,0 +633,0 @@ callback(err, null, resp); |
@@ -112,3 +112,5 @@ /* | ||
* | ||
* @param {Object} document | ||
* @param {Object} request | ||
* The request object that will be sent. | ||
* @param {Object} request.document | ||
* Input document. Currently, `analyzeSentiment` only supports English text | ||
@@ -125,4 +127,4 @@ * ({@link Document.language}="EN"). | ||
* The second parameter to the callback is an object representing [AnalyzeSentimentResponse]{@link AnalyzeSentimentResponse} | ||
* @returns {gax.EventEmitter} - the event emitter to handle the call | ||
* status. | ||
* @returns {Promise} - The promise which resolves to the response object. | ||
* The promise has a method named "cancel" which cancels the ongoing API call. | ||
* | ||
@@ -133,14 +135,9 @@ * @example | ||
* var document = {}; | ||
* api.analyzeSentiment(document, function(err, response) { | ||
* if (err) { | ||
* console.error(err); | ||
* return; | ||
* } | ||
* api.analyzeSentiment({document: document}).then(function(response) { | ||
* // doThingsWith(response) | ||
* }).catch(function(err) { | ||
* console.error(err); | ||
* }); | ||
*/ | ||
LanguageServiceApi.prototype.analyzeSentiment = function analyzeSentiment( | ||
document, | ||
options, | ||
callback) { | ||
LanguageServiceApi.prototype.analyzeSentiment = function(request, options, callback) { | ||
if (options instanceof Function && callback === undefined) { | ||
@@ -153,6 +150,3 @@ callback = options; | ||
} | ||
var req = { | ||
document: document | ||
}; | ||
return this._analyzeSentiment(req, options, callback); | ||
return this._analyzeSentiment(request, options, callback); | ||
}; | ||
@@ -164,7 +158,9 @@ | ||
* | ||
* @param {Object} document | ||
* @param {Object} request | ||
* The request object that will be sent. | ||
* @param {Object} request.document | ||
* Input document. | ||
* | ||
* This object should have the same structure as [Document]{@link Document} | ||
* @param {number} encodingType | ||
* @param {number} request.encodingType | ||
* The encoding type used by the API to calculate offsets. | ||
@@ -180,4 +176,4 @@ * | ||
* The second parameter to the callback is an object representing [AnalyzeEntitiesResponse]{@link AnalyzeEntitiesResponse} | ||
* @returns {gax.EventEmitter} - the event emitter to handle the call | ||
* status. | ||
* @returns {Promise} - The promise which resolves to the response object. | ||
* The promise has a method named "cancel" which cancels the ongoing API call. | ||
* | ||
@@ -189,15 +185,13 @@ * @example | ||
* var encodingType = EncodingType.NONE; | ||
* api.analyzeEntities(document, encodingType, function(err, response) { | ||
* if (err) { | ||
* console.error(err); | ||
* return; | ||
* } | ||
* var request = { | ||
* document: document, | ||
* encodingType: encodingType | ||
* }; | ||
* api.analyzeEntities(request).then(function(response) { | ||
* // doThingsWith(response) | ||
* }).catch(function(err) { | ||
* console.error(err); | ||
* }); | ||
*/ | ||
LanguageServiceApi.prototype.analyzeEntities = function analyzeEntities( | ||
document, | ||
encodingType, | ||
options, | ||
callback) { | ||
LanguageServiceApi.prototype.analyzeEntities = function(request, options, callback) { | ||
if (options instanceof Function && callback === undefined) { | ||
@@ -210,7 +204,3 @@ callback = options; | ||
} | ||
var req = { | ||
document: document, | ||
encodingType: encodingType | ||
}; | ||
return this._analyzeEntities(req, options, callback); | ||
return this._analyzeEntities(request, options, callback); | ||
}; | ||
@@ -224,11 +214,13 @@ | ||
* | ||
* @param {Object} document | ||
* @param {Object} request | ||
* The request object that will be sent. | ||
* @param {Object} request.document | ||
* Input document. | ||
* | ||
* This object should have the same structure as [Document]{@link Document} | ||
* @param {Object} features | ||
* @param {Object} request.features | ||
* The enabled features. | ||
* | ||
* This object should have the same structure as [Features]{@link Features} | ||
* @param {number} encodingType | ||
* @param {number} request.encodingType | ||
* The encoding type used by the API to calculate offsets. | ||
@@ -244,4 +236,4 @@ * | ||
* The second parameter to the callback is an object representing [AnnotateTextResponse]{@link AnnotateTextResponse} | ||
* @returns {gax.EventEmitter} - the event emitter to handle the call | ||
* status. | ||
* @returns {Promise} - The promise which resolves to the response object. | ||
* The promise has a method named "cancel" which cancels the ongoing API call. | ||
* | ||
@@ -254,16 +246,14 @@ * @example | ||
* var encodingType = EncodingType.NONE; | ||
* api.annotateText(document, features, encodingType, function(err, response) { | ||
* if (err) { | ||
* console.error(err); | ||
* return; | ||
* } | ||
* var request = { | ||
* document: document, | ||
* features: features, | ||
* encodingType: encodingType | ||
* }; | ||
* api.annotateText(request).then(function(response) { | ||
* // doThingsWith(response) | ||
* }).catch(function(err) { | ||
* console.error(err); | ||
* }); | ||
*/ | ||
LanguageServiceApi.prototype.annotateText = function annotateText( | ||
document, | ||
features, | ||
encodingType, | ||
options, | ||
callback) { | ||
LanguageServiceApi.prototype.annotateText = function(request, options, callback) { | ||
if (options instanceof Function && callback === undefined) { | ||
@@ -276,8 +266,3 @@ callback = options; | ||
} | ||
var req = { | ||
document: document, | ||
features: features, | ||
encodingType: encodingType | ||
}; | ||
return this._annotateText(req, options, callback); | ||
return this._annotateText(request, options, callback); | ||
}; | ||
@@ -284,0 +269,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
72420
1558
+ Addedgoogle-gax@0.8.1(transitive)
- Removedeventemitter2@2.0.2(transitive)
- Removedgoogle-gax@0.7.0(transitive)
Updatedgoogle-gax@^0.8.0