gulch/transliterato

Package for replace text chars

1.0.0 2020-02-16 12:20 UTC

This package is not auto-updated.

Last update: 2020-03-30 11:35:12 UTC


README

Build Status Coverage Status Scrutinizer Code Quality

gulch/transliterato

Install

You will need Composer installed.

composer require gulch/transliterato

How to use

use gulch\Transliterato\Processor;
use gulch\Transliterato\Scheme\UkrToEngKeyboardLayout;

$processor = new Processor(new UkrToEngKeyboardLayout());
echo $processor->process('Руддщ цщкдв!'); // Hello world!
use gulch\Transliterato\BatchProcessor;
use gulch\Transliterato\Scheme\UkrToEngKeyboardLayout;
use gulch\Transliterato\Scheme\UkrToRusKeyboardLayout;

$processor = new BatchProcessor(
    new UkrToEngKeyboardLayout(),
    new UkrToRusKeyboardLayout()
);
$result = $processor->process('Руддщ фдд еру цщкдві!');
var_export($result); // array (0 => 'Hello all the worlds!', 1 => 'Руддщ фдд еру цщкдвы!',)
use gulch\Transliterato\Processor;
use gulch\Transliterato\Scheme\CyrToLatinTranslit;

$processor = new Processor(new CyrToLatinTranslit());
echo $processor->process('простий приклад'); //prostiy priklad