1.0.2 • Published 2 years ago

kiingo-api v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

npm version

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