slovoform

Library for plural and gender word forms for Russian language

npm install slovoform
3 downloads in the last week
13 downloads in the last month

Slovoform

Library for plural and gender word forms for russian language

Examples

Very easy to use:

var slovoform = require('slovoform'),
    pluralize = new slovoform.Pluralize(),
    genderify = new slovoform.Genderify();

pluralize.add('час', 'часа', 'часов');
console.log(pluralize.get('час', 1));
//час
console.log(pluralize.get('час', 2));
//часа
console.log(pluralize.get('час', 5));
//часов

genderify.add('сказал', 'сказала');
console.log(genderify.get('сказал', 'male'));
//сказал
console.log(genderify.get('сказал', 'female'));
//сказала
npm loves you