gulch/transliterato

Package for replace text chars

1.0.2 2021-01-31 16:57 UTC

This package is auto-updated.

Last update: 2024-11-29 05:33:32 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