npm install dandelion-api
var API = require('node-dandelion');
var Dandelion = new API.Dandelion()
Dandelion.setToken('xxxxxxx');
Dandelion.getEntities({'text': 'The brown fox and the doctor'})
.then(function(data){
console.log(data.body);
})
.catch(function(err){
console.log(err);
});
Dandelion.getSentiment({'text': 'This is such a great library! I cannot believe I was able to survive in the wilderness without it by my side. You saved my life!!'})
.then(function(data){
console.log(data.body);
})
.catch(function(err){
console.log(err);
});
npm test
Here's a list of possible tasks that you might find interesting!
- Add more endpoints. See the official documentation for inspiration
- Add the option to specify input language rather than rely on automatic detection
- Entity Extraction: allow to set additional options as per API documentation
- Make default token.isQuery to true and token name to 'token' #1
the API is generated by using swagger-js-codegen so most of the work is done by editing the .json OpenAPI definition. The generated file needs some tweaking so make sure you don't lose those changes