Iuliia
Cyrillic → Latin transliteration for Crystal.
The library includes all main international and Russian transliteration standards. For schema details and other information, see https://github.com/nalgeon/iuliia (schemas ❤️) and https://iuliia.ru (in Russian).
Quickstart
require "iuliia"
Iuliia::Wikipedia.translate("Национальный Технический Университет «Днепровская политехника»")
# 🇷🇺 => "Natsionalny Tekhnichesky Universitet «Dneprovskaya Politekhnika»"
Iuliia::Wikipedia.translate("Національний Технічний Університет «Дніпровська Політехніка»")
# 🇺🇦 => "Natsіonalny Tekhnіchny Unіversitet «Dnіprovska Polіtekhnіka»"
Iuliia::Wikipedia.translate("Фёдор Достоевский")
# => "Fyodor Dostoyevsky"
Iuliia::IcaoDoc9303.translate("Фёдор Достоевский")
# => "Fedor Dostoevskii"
Performance
Library | Throughput | -------------------------------------------------|-----------------------| Crystal | 544,680 words/sec | Go | 591,711 words/sec | Ruby | 32,269 words/sec |
REPL
In the examples
folder you can find a small REPL to play with.
$ crystal examples/repl.cr
[iuliia] >> Кто твой любимый преподаватель?
=> Kto tvoy lyubimy prepodavatel?
[iuliia] >> Кафе находится вниз по лестнице
=> Kafe nakhoditsya vniz po lestnitse
[iuliia] >>
Supported schemas
For examples and specifics, please refer to 📚 the documentation.
- ALA-LC transliteration schema (📚 docs)
- ALA-LC alternative transliteration schema (📚 docs)
- BGN/PCGN transliteration schema (📚 docs)
- BGN/PCGN alternative transliteration schema (📚 docs)
- British Standard 2979:1958 transliteration schema (📚 docs)
- British Standard 2979:1958 alternative transliteration schema (📚 docs)
- GOST 16876-71 (aka GOST 1983) transliteration schema (📚 docs)
- GOST 16876-71 (aka GOST 1983) alternative transliteration schema (📚 docs)
- GOST R 52290-2004 transliteration schema (📚 docs)
- GOST R 52535.1-2006 transliteration schema (📚 docs)
- GOST R 7.0.34-2014 transliteration schema (📚 docs)
- GOST 7.79-2000 (aka ISO 9:1995) transliteration schema (📚 docs)
- GOST 7.79-2000 (aka ISO 9:1995) alternative transliteration schema (📚 docs)
- ICAO DOC 9303 transliteration schema (📚 docs)
- ISO/R 9:1954 transliteration schema (📚 docs)
- ISO/R 9:1968 transliteration schema (📚 docs)
- ISO/R 9:1968 alternative transliteration schema (📚 docs)
- Moscow Metro map transliteration schema (📚 docs)
- MVD 310-1997 transliteration schema (📚 docs)
- MVD 310-1997 french transliteration schema (📚 docs)
- MVD 782-2000 transliteration schema (📚 docs)
- Scientific transliteration schema (📚 docs)
- Telegram transliteration schema (📚 docs)
- UNGEGN 1988 V/18 transliteration schema (📚 docs)
- Wikipedia transliteration schema (📚 docs)
- Yandex.Maps transliteration schema (📚 docs)
- Yandex.Money transliteration schema (📚 docs)
Installation
-
Add the dependency to your
shard.yml
:dependencies: iuliia: github: kandayo/iuliia
-
Run
shards install
Development
To import Iuliia schemas, run crystal schema_importer/importer.cr
.
Contributing
- Fork it (https://github.com/kandayo/iuliia-cr/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Contributors
- kandayo - creator and maintainer