JSPM

  • Created
  • Published
  • Downloads 36
  • Score
    100M100P100Q57557F
  • License MIT

Port of PHP Vocative library for Serbian language

Package Exports

  • vokativ-js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (vokativ-js) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Vokativ JS

Acknowledgements

This is a NodeJS port of PHP Vocative case library for Serbian language written by Nemanja Avramovic.

Original idea and PHP implementation can be found at Vokativ.

Installation

npm install vokativ-js

Optionally you can add --save flag to update package.json dependency list

Usage

Using vocativ-js with promises (from Q library)

var vocative = require('vokativ-js');

vocative.promised('Vuk')
    .then(function(value){
        console.log("Zdravo " + value); // Will reply with "Zdravo Vuče"
    });

Using vocativ-js with callbacks

var vocative = require('vokativ-js');

vocative.async('Вук', function(err, value){
    if(!err){
        console.log("Здраво " + value); // Will reply with "Здраво Вуче" - so cyrillic script works as well
    }
});

Note:

Due to significant similarity, this library should also work just fine with Croatian, Bosnian, Montenegrin languages, but if there are any rules that algorithm may have missed feel free to contact me or make a pull request.

If we find significant incompatibilities between any of the languages we could change API to something like this

    var promised 	= function(name, lang) { };
    var async		= function(name, lang, callback) { };

Where lang could be equal to sr, hr, ba, me