english-core 0.0.3

English language inflector
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::grammar::*;

impl English {
    pub fn adjective(word: &str, number: &Number) -> String {
        match number {
            Number::Singular => word.to_string(),
            Number::Plural => match word {
                "a" | "an" => "some".to_string(),
                "this" => "these".to_string(),
                "that" => "those".to_string(),
                _ => word.to_string(),
            },
        }
    }
    //dog's -> dogs', child's -> children's, Mary's -> Marys'
    //  pub fn genitive_adjective(word: &str, number: &Number) -> String {}
}