0.2.1 |
|
---|
#5 in #animate
150 downloads per month
2.5MB
832 lines
Inflector for the Interslavic language
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
}
Dependencies
~1.4–2.2MB
~34K SLoC