This is a JavaScript port of PHP Vocative case library for Serbian language written by Nemanja Avramovic.
Original idea and PHP implementation can be found at Vokativ.
npm install vokativ-js
Optionally you can add --save
flag to update package.json
dependency list
var Vocative = require("vokativ-js").Vocative;
var v = new Vocative();
v.make("Vuk").then((vocative) => {
console.log(vocative);
});
var Vocative = require("vokativ-js").Vocative;
async function demo() {
var v = new Vocative();
let name = await v.make("Vuk");
console.log(name);
}
demo();
import { Vocative } from "vokativ-js";
let v = new Vocative();
v.make("Vuk").then((vocative) => {
console.log(vocative);
});
import { Vocative } from "vokativ-js";
let v = new Vocative();
console.log(v.call("Vuk"));
Due to significant similarity, this library should also work just fine with former Yugoslav languages such as Croatian, Bosnian, Montenegrin, but if there are any rules that were missed feel free to contact me or make a pull request.
Author: vuk
Source Code: https://github.com/vuk/vokativ-js
License: MIT license