Coder Social home page Coder Social logo

ahrary / cyrtolattranslitjs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zsaidov/cyrtolattranslitjstj

0.0 0.0 0.0 16 KB

Simple JavaScript function for converting Cyrillic symbols to Latin

License: MIT License

JavaScript 68.88% TypeScript 1.66% HTML 29.46%

cyrtolattranslitjs's Introduction

CyrToLatTranslitJS

Ultra-lightweight JavaScript library for converting Cyrillic symbols to Translit and vice versa

Demo page

Install

npm install --save cyrToLatTranslit

Simple to use

import CyrillicToTranslit from 'CyrToLatTranslit.js';

const cyrillicToTranslit = new CyrToLatTranslit();

cyrillicToTranslit.transform('Салом Ахмад', '_');

Constructor

  • { preset: tj } or empty - transliteration preset for Tajik language.
  • { preset: ru } - transliteration preset for Russian language.

transform()

Convert Cyrillic symbols to Translit

cyrillicToTranslit().transform(input, spaceReplacement);

  • input - string which should be transformed
  • spaceReplacement - symbol for space replacement

reverse()

Convert Translit symbols to Cyrillic

cyrillicToTranslit().reverse(input, spaceReplacement);

  • input - string which should be transformed
  • spaceReplacement - symbol for space replacement

Examples

  • transform()
  cyrillicToTranslit().transform('Азию Плюс');

  > Aziya Plyus
  • reverse()
  cyrillicToTranslit().reverse("Aziya Plyus")

 > Азию Плюс

Typescript

Typescript supports starting form v2.0.0. See definitions here

License

MIT © Zohid Saidov

cyrtolattranslitjs's People

Contributors

zsaidov 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.