npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

elaenka

v2.3.0

Published

A Nodejs client for the ELAENKA NLP API

Downloads

27

Readme

node-elaenka

Node-elaenka is a Nodejs client for the ELAENKA NLP API: https://rapidapi.com/nwatson/api/elaenka-nlp

Setup Instructions

Install

Run npm install node-elaenka

Set up a RapidAPI key

Go to the ELAENKA NLP API's page within RapidAPI specified above. You can sign up as a user there and get an API key.

Getting Started

Here is a sample use of node-elaenka, useful for making sure you have set up everything:

"use strict";
const Elaenka = require('../node-elaenka/node-elaenka.js');
const client = Elaenka.makeClient('YOUR API KEY HERE');
client['rus'].bgn_pcgn('Екатерина Петро́вна Замоло́дчикова', function(err, data){
	console.log(err);
	console.log(data);
});
//This should print null, followed by Yekaterina Petróvna Zamolódchikova.

Structure

The object returned by requireing node-elaenka has the following:

  • A function named makeClient, which returns an object with the actual functions for interacting with the ELAENKA NLP API. The object's keys are strings, where each key is a 3-letter language or script code. Each value within said object is an object which consists of methods for test transformation and manipulation.
  • Each function within the makeClient object follows the same specification. They take 2 parameters: a string to be manipulated and a callback. The callback takes 2 parameters: an error which may or may not be null and a result string which may or may not be null.
  • A function called makePromiseClient, which takes a function from the returned object from makeClient, and returns a promisified equivalent.

Reference

  • makePromiseClient : This takes a parameter of a function which takes a text and error/response callback, and returns an equivalent promise.
"use strict";
const Elaenka = require('../node-elaenka/node-elaenka.js');
const client = Elaenka.makeClient('YOUR API KEY HERE');
const toBeTransformed = client['ukr'].ukrainian_passport_2010;
const p = Elaenka.makePromiseClient(toBeTransformed);
p.then(function(text){
  console.log(text);
}).catch(function(err){
  console.err(err);
});
  • makeClient : Takes a RapidAPI API key, and returns an object of the following structure:
{
  'bel':{
    belarus_geo_2007: function(text, callback(err, result))//Latinizes Cyrillic text in the Belarusian language to the 2007 Belarusian government standard for locations.
  },
	'bul':{
	  bulgarian_government_romanization: function(text, callback(err, result))//Latinizes Cyrillic text in the Bulgarian language to the Bulgarian government standard.
	},
	'kaz':{
	  cyrillic_to_latin_2018: function(text, callback(err, result))//Latinizes Cyrillic text in the Kazakh language to the 2018 Kazakhstan government standard.
	},
  'hbs':{
    cyrillicToLatin: function(text, callback(err, result)), //Latinizes Cyrillic text in the Bosnian/Croatian/Montenegrin/Serbian language family
    latinToCyrillic: function(text, callback(err, result)) //Cyrillicizes Latin-alphabet text in the Bosnian/Croatian/Montenegrin/Serbian language family
  },
  'rus':{
    passport2013: function(text, callback(err, result)), //Romanizes Russian to the 2013 Passport standard
    bgn_pcgn: function(text, callback(err, result)) //Romanizes Russian to the BGN/PCGN standard
  },
  'ukr':{
    ukrainian_passport_2010: function(text, callback(err, result)) //Romanizes Ukrainian to the 2010 government standard for Passports.
  },
  'mkd':{
    icao_9303: function(text, callback(err, result)) //Romanizes Macedonian to the ICAO 9303 standard.
  },
  'jpn':{
    variant_kana_normalization: function(text, callback(err, result)) //Takes Japanese text; converts the enclosed characters, half-width characters, and hentaigana; and converts them into standardized Hiragana and Katakana.
  },
	'kor':{
		hanyangToUnicode: function(text, callback(err, result)) //Takes Korean text and replaces any Hanyang private characters with their Unicode equivalents.
	},
	'mon':{
		mongolianGovernmentRomanization: function(text, callback(err, result)), //Romanizes Cyrillic Mongolian text to the Mongolilan government standard.
		menksoftToUnicode: function(text, callback(err, result)), //Converts from Menksoft private characters to standard Unicode
		unicodeToMenksoft: function(text, callback(err, result))  //Converts from standard Unicode to Menksoft private characters
	},
	'jje':{},//see kor
	'okm':{},//see kor
	'oko':{},//see kor
	'mac':{},//see mkd
  'scr':{},//See hbs
  'scc':{},//See hbs
  'bos':{},//See hbs
  'cnr':{},//See hbs
  'hrv':{},//See hbs
  'kjv':{},//See hbs
  'srp':{},//See hbs
  'khk':{},//See mon
  'mvf':{},//See mon
  'svm':{}//See hbs
}