Git Product home page Git Product logo

iuliia-js's Introduction

Iuliia

Transliterate Cyrillic → Latin in every possible way

This is the TypeScript port of the Python iuliia package

NPM Version Build Status Code Coverage Code Quality

Transliteration means representing Cyrillic data (mainly names and geographic locations) with Latin letters. It is used for international passports, visas, green cards, driving licenses, mail and goods delivery etc.

Iuliia makes transliteration as easy as:

> import iuliia from "iuliia";
> iuliia.translate("Юлия Щеглова", iuliia.WIKIPEDIA);
'Yuliya Shcheglova'

Why use Iuliia

  • 20 transliteration schemas (rule sets), including all main international and Russian standards.
  • Correctly implements not only the base mapping, but all the special rules for letter combinations and word endings.
  • Simple API and zero third-party dependencies.

For schema details and other information, see https://dangry.ru/iuliia (in Russian).

Issues and limitations

Installation

npm install iuliia

Usage

ES2015 JavaScript:

import iuliia from "iuliia";

// list all supported schemas
for (let schemaName of iuliia.Schemas.names()) {
    console.log(schemaName);
}

// transliterate using specified schema
let source = "Юлия Щеглова";
iuliia.translate(source, iuliia.ICAO_DOC_9303);
// "Iuliia Shcheglova"

// or pick schema by name
let schema = iuliia.Schemas.get("wikipedia");
iuliia.translate(source, schema);
// "Yuliya Shcheglova"

ES5 browser JavaScript:

<script src="https://unpkg.com/iuliia@latest/dist/umd/iuliia.min.js"></script>
<script>
    var source = "Юлия Щеглова";
    var result = iuliia.translate(source, iuliia.WIKIPEDIA);
    console.log(result);
</script>

Supported schemas:

ala_lc          iuliia.ALA_LC
ala_lc_alt      iuliia.ALA_LC_ALT
bgn_pcgn        iuliia.BGN_PCGN
bgn_pcgn_alt    iuliia.BGN_PCGN_ALT
bs_2979         iuliia.BS_2979
bs_2979_alt     iuliia.BS_2979_ALT
gost_779        iuliia.GOST_779
gost_779_alt    iuliia.GOST_779_ALT
gost_7034       iuliia.GOST_7034
gost_16876      iuliia.GOST_16876
gost_16876_alt  iuliia.GOST_16876_ALT
gost_52290      iuliia.GOST_52290
gost_52535      iuliia.GOST_52535
icao_doc_9303   iuliia.ICAO_DOC_9303
iso_9_1954      iuliia.ISO_9_1954
iso_9_1968      iuliia.ISO_9_1968
iso_9_1968_alt  iuliia.ISO_9_1968_ALT
mosmetro        iuliia.MOSMETRO
mvd_310         iuliia.MVD_310
mvd_310_fr      iuliia.MVD_310_FR
mvd_782         iuliia.MVD_782
scientific      iuliia.SCIENTIFIC
telegram        iuliia.TELEGRAM
ungegn_1987     iuliia.UNGEGN_1987
wikipedia       iuliia.WIKIPEDIA
yandex_maps     iuliia.YANDEX_MAPS
yandex_money    iuliia.YANDEX_MONEY

Development setup

$ npm install
$ npm run format && npm run lint && npm test && npm run build

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Make sure to add or update tests as appropriate.

Use Conventional Commits for commit messages.

Changelog

License

MIT

iuliia-js's People

Contributors

bespoyasov avatar dependabot[bot] avatar nalgeon avatar

Watchers

 avatar

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.