This is a Node module to handle the client side of the Text Analytics API.
Install the module from NPM
npm install textanalytics
Including the module in the source defines the TextAnalytics class. The constructor for the class takes a configuration object.
var TextAnalytics = require('textanalytics');
var textanalytics = new TextAnalytics(config);
The class offers one function, which requires a callback for success and error conditions:
var callback = function(err, rsp) { };
Where rsp is the body of the (JSON) response in object form, and err is an Error
object containing information about the failure, or null if the call succeeded.
var TextAnalytics = require('textanalytics');
var config = {
apikey : '(Example key)'
};
var textanalytics = new TextAnalytics(config);
textanalytics.analyze('I love NodeJS.', (err, rsp) => {
if (err)
return console.log(err);
console.log(rsp);
});
This module is licensed under the MIT License. Copyright © 2017, Verint Inc.