Skip to content

Commit

Permalink
add rust package
Browse files Browse the repository at this point in the history
  • Loading branch information
paiv committed Nov 30, 2024
1 parent 6a7d2bb commit 0e21b7b
Show file tree
Hide file tree
Showing 12 changed files with 2,275 additions and 13 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/build-rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Rust

on:
push:
tags:
- '[0-9]**'
pull_request:
branches: [main]
paths:
- 'rust/**'

jobs:

build-rust:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Test
working-directory: ${{github.workspace}}/rust
run: cargo test -q
12 changes: 11 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Ukrainian Cyrillic transliteration to Latin script.
[![standwithukraine](docs/StandWithUkraine.svg)](https://ukrainewar.carrd.co/)
[![](https://github.com/paiv/uklatn/actions/workflows/test-builds.yml/badge.svg)](https://github.com/paiv/uklatn/actions)

[JavaScript](#javascript-package) | [Python](#python-module) | [C](c/) | [Java](#java-library) | [.NET](#net-package) | [Go](#go-package) | [PHP](#php-package) | [Elixir](#elixir-package) | [Swift](#swift-package) | [Ruby](#ruby-gem)
[JavaScript](#javascript-package) | [Python](#python-module) | [C](c/) | [Java](#java-library) | [.NET](#net-package) | [Go](#go-package) | [PHP](#php-package) | [Elixir](#elixir-package) | [Swift](#swift-package) | [Ruby](#ruby-gem) | [Rust](#rust-crate)

Supported transliteration schemes:
- [DSTU 9112:2021](https://uk.wikipedia.org/wiki/ДСТУ_9112:2021)
Expand Down Expand Up @@ -114,6 +114,16 @@ gem 'uklatn'
```


Rust crate
--
- [uklatn Rust crate](rust/)

Add package dependency:
```sh
cargo add uklatn
```


Notes
--
Input is assumed to be in Ukrainian (Cyrillic or Latin script), and will be processed in full.
Expand Down
1 change: 1 addition & 0 deletions rust/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
target/
100 changes: 100 additions & 0 deletions rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[package]
name = "uklatn"
version = "1.18.0"
license = "MIT"
homepage = "https://github.com/paiv/uklatn"
repository = "https://github.com/paiv/uklatn"
description = "Ukrainian Cyrillic transliteration to Latin script"
keywords = ["ukraine", "transliteration", "romanization"]
authors = ["Pavlo Ivashkov"]
edition = "2021"

[dependencies]
fancy-regex = "0.14.0"
once_cell = "1.20.2"
unicode-normalization = "0.1.20"
31 changes: 31 additions & 0 deletions rust/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
uklatn
==
Ukrainian Cyrillic transliteration to Latin script.

Supported transliteration schemes:
- [DSTU 9112:2021](https://uk.wikipedia.org/wiki/ДСТУ_9112:2021)
- [KMU 55:2010](https://zakon.rada.gov.ua/laws/show/55-2010-п)


Usage
--

```rust
use { uklatn::Table, uklatn::decode, uklatn::encode };

encode("Доброго вечора!", Table::default());
decode("Paljanycja", Table::default());
```

Select a transliteration scheme:

```rust
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.

Loading

0 comments on commit 0e21b7b

Please sign in to comment.