Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@google-cloud/language

Package Overview
Dependencies
Maintainers
1
Versions
87
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@google-cloud/language - npm Package Compare versions

Comparing version 0.4.0 to 0.5.0

4

package.json
{
"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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc