kiingo-api
v1.0.2
Published
A Javascript SDK for the Kiingo NLP API
Downloads
6
Readme
Installing
Using npm:
$ npm install kiingo-api
Using bower:
$ bower install kiingo-api
Using yarn:
$ yarn add kiingo-api
Examples
Get Associations
const { KiingoAPI, AssociationsRequest, AssociationsResponse } = require('kiingo-api');
const api = new KiingoAPI();
const apiKey = 'MY-API-KEY';
const secretKey = 'MY-SECRET-KEY';
api.initialize(apiKey, secretKey);
const queryText = 'cloudy';
var request = new AssociationsRequest(queryText);
api.getAssociations(request)
.then((response) => {
// TODO: Process results
})
.catch((ex) => {
// TODO: Handle Exception
});
Tag Parts-of-Speech
const { KiingoAPI, PartOfSpeechTaggerRequest, PartOfSpeechModel, PartOfSpeechTaggerResponse } = require('kiingo-api');
const api = new KiingoAPI();
const apiKey = 'MY-API-KEY';
const secretKey = 'MY-SECRET-KEY';
api.initialize(apiKey, secretKey);
const queryText = 'The quick brown fox jumps over the lazy dog.';
const model = PartOfSpeechModel.standard;
var request = new PartOfSpeechTaggerRequest(queryText, model);
api.tagPartsOfSpeech(request)
.then((response) => {
// TODO: Process results
})
.catch((ex) => {
// TODO: Handle Exception
});