gulch / transliterato
Package for replace text chars
1.0.2
2021-01-31 16:57 UTC
Requires
- php: >=7.4
Requires (Dev)
- php-coveralls/php-coveralls: ^2.2
- phpunit/phpunit: ^9.0
- squizlabs/php_codesniffer: ^3.2
This package is auto-updated.
Last update: 2024-10-29 05:23:14 UTC
README
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