petrovich

Crates.iopetrovich
lib.rspetrovich
version0.2.0
sourcesrc
created_at2016-02-16 06:29:32.546132
updated_at2020-04-06 22:08:30.808172
descriptionPetrovich is library which inflects Russian names to given grammatical case. It supports first names, last names and middle names inflections.
homepage
repositoryhttps://github.com/Latrasis/petrovich-rs
max_upload_size
id4189
size48,431
Jacob Payne (Latrasis)

documentation

README

Petrovich-rs

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.

Usage

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"

Examples

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), "Прокопьевну");
}
Commit count: 46

cargo fmt