Crates.io | petrovich |
lib.rs | petrovich |
version | 0.2.0 |
source | src |
created_at | 2016-02-16 06:29:32.546132 |
updated_at | 2020-04-06 22:08:30.808172 |
description | Petrovich is library which inflects Russian names to given grammatical case. It supports first names, last names and middle names inflections. |
homepage | |
repository | https://github.com/Latrasis/petrovich-rs |
max_upload_size | |
id | 4189 |
size | 48,431 |
Petrovich is library which inflects Russian names to given grammatical case. It supports first names, last names and middle names inflections.
Petrovich-rs is Rust implementation of Petrovich ruby gem.
This crate is on crates.io and can be
used by adding petrovich
to the dependencies in your project's Cargo.toml
.
[dependencies]
petrovich = "0.2"
use petrovich::*;
fn main() {
assert_eq!(firstname(Gender::Male, "Саша", Case::Dative), "Саше");
assert_eq!(firstname(Gender::Female, "Изабель", Case::Genitive), "Изабель");
assert_eq!(lastname(Gender::Male, "Станкевич", Case::Prepositional), "Станкевиче");
assert_eq!(lastname(Gender::Female, "Станкевич", Case::Prepositional), "Станкевич");
assert_eq!(middlename(Gender::Male, "Сергеич", Case::Instrumental), "Сергеичем");
assert_eq!(middlename(Gender::Female, "Прокопьевна", Case::Accusative), "Прокопьевну");
}