How to use the inflected.transliterations function in inflected

To help you get started, we’ve selected a few inflected examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github openspending / os-packager / app / services / utils.js View on Github external
'use strict';

var _ = require('underscore');
var Promise = require('bluebird');
var GoodTables = require('goodtables');
var csv = require('papaparse');
var jts = require('json-table-schema');
var inflector = require('inflected');

inflector.transliterations(function(t) {
  t.approximate('А', 'A');  t.approximate('а', 'a');
  t.approximate('Б', 'B');  t.approximate('б', 'b');
  t.approximate('В', 'V');  t.approximate('в', 'v');
  t.approximate('Г', 'G');  t.approximate('г', 'g');
  t.approximate('Ґ', 'G');  t.approximate('ґ', 'g');
  t.approximate('Д', 'D');  t.approximate('д', 'd');
  t.approximate('Е', 'E');  t.approximate('е', 'e');
  t.approximate('Є', 'Je'); t.approximate('є', 'je');
  t.approximate('Ж', 'Zh'); t.approximate('ж', 'zh');
  t.approximate('З', 'Z');  t.approximate('з', 'z');
  t.approximate('И', 'Y');  t.approximate('и', 'y');
  t.approximate('І', 'I');  t.approximate('і', 'i');
  t.approximate('Ї', 'Ji'); t.approximate('ї', 'ji');
  t.approximate('Й', 'J');  t.approximate('й', 'j');
  t.approximate('К', 'K');  t.approximate('к', 'k');
  t.approximate('Л', 'L');  t.approximate('л', 'l');