Skip to content

giulioprinaricotti/node-dandelion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

Coverage Status

#A nodejs client for the Dandelion API.

Installation

npm install dandelion-api

Usage

Initialize

var API = require('node-dandelion');

var Dandelion = new API.Dandelion()

Dandelion.setToken('xxxxxxx');

Entity Extraction

Dandelion.getEntities({'text': 'The brown fox and the doctor'})
.then(function(data){
	console.log(data.body);
})
.catch(function(err){
	console.log(err);
});

Sentiment

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);
});

Tests

npm test

Contributing

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