textanalytics
v1.0.8
Published
A Node module to handle the client side of Microsoft's Text Analytics API.
Downloads
2
Readme
Text Analytics API Proxy Module
This is a Node module to handle the client side of the Text Analytics API.
Installation
Install the module from NPM
npm install textanalytics
Usage
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.
Full Example
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);
});
License
This module is licensed under the MIT License. Copyright © 2017, Verint Inc.