You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

shevchenko

Package Overview
Dependencies
Maintainers
0
Versions
120
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

shevchenko

JavaScript library for declension of Ukrainian anthroponyms

3.1.4
latest
Source
npmnpm
Version published
Maintainers
0
Created
Source

shevchenko.js

JavaScript library for declension of Ukrainian anthroponyms.

NPM Version NPM Downloads Docker Pulls

Extensions

User Guide

Installation

npm

To install the library using npm package manager, use the following command:

npm install --save shevchenko

Import

The library comes in three formats: CommonJS module, ECMAScript module, and a minified UMD bundle. You can select the format that best suits your needs.

CommonJS

To import the library as a CommonJS module, use the following code:

const shevchenko = require('shevchenko');

ECMAScript

To import the library as an ECMAScript module, use the following code:

import * as shevchenko from 'shevchenko';

UMD

To import the library as a UMD bundle, include the following script tag in your HTML code:

<‍script type="text/javascript" src="https://unpkg.com/shevchenko"><‍/script>

Use Cases

Personal names declension

This example shows how to use the library to decline Ukrainian anthroponyms.

const shevchenko = require('shevchenko');

async function main() {
  const input = {
    gender: 'masculine',
    givenName: 'Тарас',
    patronymicName: 'Григорович',
    familyName: 'Шевченко'
  };

  const output = await shevchenko.inVocative(input);

  console.log(output); // { givenName: "Тарасе", patronymicName: "Григоровичу", familyName: "Шевченку" }
}

main().catch((error) => console.error(error));

Automatic grammatical gender detection

This example shows how to use the library to automatically detect the grammatical gender of a Ukrainian anthroponym.

const shevchenko = require('shevchenko');

async function main() {
  const anthroponym = {
    givenName: 'Лариса',
    patronymicName: 'Петрівна',
    familyName: 'Косач-Квітка'
  };

  const gender = await shevchenko.detectGender(anthroponym); // "feminine"
  if (gender == null) {
    throw new Error('Failed to detect grammatical gender.');
  }

  const input = { ...anthroponym, gender };

  const output = await shevchenko.inVocative(input);

  console.log(output); // { givenName: "Ларисо", patronymicName: "Петрівно", familyName: "Косач-Квітко" }
}

main().catch((error) => console.error(error));

Usage via HTTP API

The library can be integrated into your project via HTTP API. Please refer to shevchenko Docker image for the additional instructions.

Keywords

ukrainian-language

FAQs

Package last updated on 04 Mar 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.