Coder Social home page Coder Social logo

ukrbublik / name-case-lib-port Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 3.0 211 KB

Port of NameCaseLib for PHP. Склонение ФИО русского и украинского языков

JavaScript 100.00%
language natural-language russian ukrainian

name-case-lib-port's People

Contributors

ukrbublik avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

name-case-lib-port's Issues

An error occurs when calling qFirstName()

Here is my code:

const GENDER_M       = 1;
const GENDER_W       = 2;

const C_NOMINATIVE   = 1; // (називний)
const C_GENITIVE     = 2; // (родовий)
const C_DATIVE       = 3; // (давальний)
const C_ACCUSATIVE   = 4; // (знахідний)
const C_INSTRUMENTAL = 5; // (орудний)
const C_LOCATIVE     = 6; // (місцевий)
const C_VOCATIVE     = 7; // (кличний)

var ncl = new NCLNameCaseUa();
var result = ncl.qFirstName('Тарас', C_GENITIVE, GENDER_M);

console.log(result);

It will raise an error with the message:

Caution

getWordCase is not defined

readyArr.push(getWordCase(words[index], number));
              ^

Please take a look at this line, here we should use an array instead of an object:

// instead this
var readyArr = {};

// we need this
var readyArr = [];

Also, we should use a keyword this:

readyArr.push(getWordCase(words[index], number));

// instead this
readyArr.push(getWordCase(words[index], number));

// we need this
readyArr.push(this.getWordCase(this.words[index], number));

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.