interslavic-rs

Crates.iointerslavic-rs
lib.rsinterslavic-rs
version0.2.1
sourcesrc
created_at2024-10-03 12:32:36.663096
updated_at2024-10-03 12:32:36.663096
descriptioninterslavic utilities in rust
homepage
repositoryhttps://github.com/gold-silver-copper/interslavic-rs
max_upload_size
id1395176
size7,203,749
gold_silver_copper (gold-silver-copper)

documentation

README

Inflector for the Interslavic language

Crates.io Documentation License Downloads

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


}

Commit count: 37

cargo fmt