2 stable releases
1.20.0 | Dec 25, 2024 |
---|---|
1.18.0 | Nov 30, 2024 |
#378 in Text processing
152 downloads per month
27KB
835 lines
uklatn
Ukrainian Cyrillic transliteration to Latin script.
Supported transliteration schemes:
Usage
use { uklatn::Table, uklatn::decode, uklatn::encode };
encode("Доброго вечора!", Table::default());
decode("Paljanycja", Table::default());
Set the transliteration scheme:
encode("Борщ", Table::Dstu9112B);
encode("Шевченко", Table::Kmu55);
Notes
Input is assumed to be in Ukrainian (Cyrillic or Latin script), and will be processed in full. If your data has mixed languages, do preprocessing to extract Ukrainian chunks.
lib.rs
:
Ukrainian Cyrillic transliteration to and from Latin script.
Tables:
- DSTU 9112:2021 System A
- DSTU 9112:2021 System B
- KMU 55:2010, not reversible
Examples
let s = uklatn::encode("Доброго вечора!", uklatn::Table::default());
assert_eq!(s, "Dobroğo večora!");
let s = uklatn::decode("Paljanycja", uklatn::Table::default());
assert_eq!(s, "Паляниця");
Set the transliteration scheme:
let s = uklatn::encode("Борщ", uklatn::Table::Dstu9112B);
assert_eq!(s, "Borshch");
let s = uklatn::encode("Шевченко", uklatn::Table::Kmu55);
assert_eq!(s, "Shevchenko");
Dependencies
~4.5MB
~95K SLoC