Declension of Ukrainian family names, given names and patronymics
Open-source JavaScript library for the declension of Ukrainian personal names
Live demo
Enter the family name, given name and patronymic in the nominative case.
Declension results
- Nominative
- Шевченко Тарас Григорович
- Genitive
- Шевченка Тараса Григоровича
- Dative
- Шевченку Тарасу Григоровичу
- Accusative
- Шевченка Тараса Григоровича
- Ablative
- Шевченком Тарасом Григоровичем
- Locative
- Шевченкові Тарасові Григоровичу
- Vocative
- Шевченку Тарасе Григоровичу
How it works
More than 120 Ukrainian grammar rules combined with machine learning.
Gender detection
If the grammatical gender is not specified, the library can detect it automatically from the patronymic or given name.
Machine learning
Family names derived from nouns and from adjectives decline differently, even when they have the same ending. A machine learning model trained on more than 40,000 family names helps tell them apart and pick the matching rule.
Sound alternation
During declension, sounds in the stem may alternate or drop out. The library applies these changes according to Ukrainian grammar.
Vocative case
The vocative form depends on the word stem, so names with the same ending may still have different vocative forms. The library handles these differences.
Compound names
Each part of a hyphenated given name or family name is declined on its own, and parts that should stay unchanged are left as is.
Indeclinable family names
Depending on gender and ending, some family names are indeclinable and keep the same form in every case. The library recognizes them and leaves them unchanged.
Documentation
Get started in three steps.
Installation
Install the package from npm. TypeScript types are included.
npm install shevchenkoImport
Load the library with require().
const shevchenko = require('shevchenko');Usage example
Declines a full name in the vocative case.
const shevchenko = require('shevchenko'); async function main() { const name = { givenName: 'Тарас', patronymicName: 'Григорович', familyName: 'Шевченко' }; const vocative = await shevchenko.inVocative({ ...name, gender: 'masculine' }); console.log(vocative); // { givenName: "Тарасе", patronymicName: "Григоровичу", familyName: "Шевченку" } } main().catch((error) => console.error(error));
- API specification (opens in a new tab)Complete reference for functions, types and parameters.
- Source code (opens in a new tab)Code, releases and issue tracker on GitHub.
- HTTP API (opens in a new tab)A Docker image that runs the library as a web service.
- Military extension betaDeclension of military ranks and appointments.