/linguacode-translator

2 side conversion: code to text; text to code.

Primary LanguageJavaScriptGNU General Public License v3.0GPL-3.0

Build Status Coverage Status Code Climate Dependency Status devDependency Status License

linguacode-translator

Description

linguacode-translator is a library which allows to translate text to code and the opposite.

How to install

yarn

yarn add https://github.com/linguacode/linguacode-translator --save

npm

npm install https://github.com/linguacode/linguacode-translator --save

Usage

var translator = require('linguacode-translator');

var text = 'տպել("բարեւ")';

var textToCode = translator.toCode(text, 'hy'); //@output("բարեւ")
var textToCodeToText = translator.toText(textToCode, 'hy'); //'տպել("բարեւ")'
console.log(text == textToCodeToText) //true

var translation = translator.translate(textToCode, 'hy', 'ru'); //'вывести("բարեւ")'

License

translator is licensed under MIT.