Skip to content

r9deyes/yatranslit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Yandex-standard russian-english transliteration

Golang adaptation of https://github.com/denismitr/translit

Usage

    translit := translit_yandex.NewTranslit()
    var out string = translit.Transform("Строка для транслитерации, по правилам Яндекс!")
	// out == "stroka-dlya-transliteracii-po-pravilam-yandeksa"

To define max length of the output do:

    translit := translit_yandex.NewTranslit()
	translit.SetMaxLenght(10)
    slug := translit.transform("очень длинный текст...");
    // slug == "ochen-dlin"

You can provide your own translit implementation as long as it implements the Translater interface and inject it into the Translit class constructor, this way it will override the default behavior like so:

    CustomTranslit := NewTranslit()
	CustomTranslit.SetStrategy(NewYourTranslitStrategyImpl())

About

yandex transliteration in Go implementation. And wasm demo:

Resources

License

Stars

Watchers

Forks

Releases

No releases published