fresh/transliteration

PHP library for transliteration.

v2.0.1 2017-11-22 09:13 UTC

README

PHP library for transliteration.

Scrutinizer Quality Score Build Status CodeCov License Latest Stable Version Total Downloads SensioLabsInsight StyleCI Gitter

Requirements

  • PHP 7.1 and later

Install via Composer

composer req fresh/transliteration='~2.0'

Available transliteration methods

From To Rules
Ukrainian English Resolution of the Cabinet of Ministers of Ukraine №55 dated January 27, 2010
http://zakon1.rada.gov.ua/laws/show/55-2010-%D0%BF
Russian English custom

Using

<?php

namespace Acme;

use Fresh\Transliteration\Transliterator;
use Fresh\Transliteration\UkrainianToEnglish;

class Foo
{
    public function bar($text)
    {
        // You can use in this way
        $transliterator = new Transliterator();
        $transliteratedText = $transliterator->ukToEn($text);

        // Or like this
        $transliteratedText = UkrainianToEnglish::transliterate($ukrainianText);
    }
}

Some examples of Ukrainian-to-English transliteration

Ukrainian text Transliterated text
Володимир Volodymyr
Богдан Bohdan
Жанна Zhanna
Наталія Nataliia
Олексій Oleksii
Уляна Uliana
Юрій Yurii

Contributing

See CONTRIBUTING file.