Crates.io | interslavic-rs |
lib.rs | interslavic-rs |
version | 0.2.1 |
source | src |
created_at | 2024-10-03 12:32:36.663096 |
updated_at | 2024-10-03 12:32:36.663096 |
description | interslavic utilities in rust |
homepage | |
repository | https://github.com/gold-silver-copper/interslavic-rs |
max_upload_size | |
id | 1395176 |
size | 7,203,749 |
This crate provides a decliner/conjugator/inflector for Interslavic.
It uses data from the official dictionary at https://interslavic-dictionary.com/
Sample usage:
use interslavic::*;
fn main() {
let mut inflector = ISV::default();
//if you do not initialize the dictionary, animate nouns will not be inflected correctly, nor will words with irregular stems
inflector.initialize_dictionary("isv_words.csv");
let noun = inflector.decline_noun("mųž", &Case::Gen, &Number::Singular);
//the output is a tuple of a string and gender
println!("{:#?}", noun.0);
//output: mųža
let adj = inflector.decline_adj(
"samy",
&Case::Gen,
&Number::Singular,
&Gender::Masculine,
true,
);
//the output is just a string
println!("{:#?}", adj);
//output: samogo
let verbik = "učiti";
let verb = inflector.conjugate_verb(
verbik,
&Person::First,
&Number::Singular,
&Gender::Feminine,
&Tense::Present,
);
println!("{:#?}", verb);
//output: učų
let lik = inflector.l_participle("buditi", &Gender::Feminine, &Number::Singular);
println!("{:#?}", lik);
//output: budila
}