Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/2do2go/slovoform.js


https://github.com/2do2go/slovoform.js

Last synced: 29 days ago
JSON representation

Awesome Lists containing this project

README

        

#Slovoform
Library for plural and gender word forms for russian language

#Examples
Very easy to use:
```js
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'));
//сказала
```