#english #learning #plural #singular #noun #pluralizes #singularizes

inflection

Pluralizes and singularizes English nouns

3 releases

0.1.2 Nov 9, 2021
0.1.1 Nov 9, 2021
0.1.0 Nov 8, 2021
0.0.1 Nov 8, 2021

#9 in #singular

Download history 22/week @ 2024-07-26 22/week @ 2024-08-02 26/week @ 2024-08-09 7/week @ 2024-08-16 9/week @ 2024-09-20 2/week @ 2024-09-27 37/week @ 2024-10-04 26/week @ 2024-10-11 21/week @ 2024-10-18 13/week @ 2024-10-25

97 downloads per month

MIT license

21KB
550 lines

inflection(Just for learning)

Inflection pluralizes and singularizes English nouns implemented by rust.

Copy from go version.

use inflection::{singular, plural};


assert_eq!(plural::<_, String>("person"), "people".to_string());
assert_eq!(plural::<_, String>("Person"), "People".to_string());
assert_eq!(plural::<_, String>("PERSON"), "PEOPLE".to_string());
assert_eq!(plural::<_, String>("bus"), "buses".to_string());
assert_eq!(plural::<_, String>("BUS"), "BUSES".to_string());
assert_eq!(plural::<_, String>("Bus"), "Buses".to_string());
assert_eq!(plural::<_, String>("FancyPerson"), "FancyPeople".to_string()); 
                                                                             
assert_eq!(singular::<_, String>("people"), "person".to_string());           
assert_eq!(singular::<_, String>("PEOPLE"), "PERSON".to_string());           
assert_eq!(singular::<_, String>("buses"), "bus".to_string());               
assert_eq!(singular::<_, String>("People"), "Person".to_string());           
assert_eq!(singular::<_, String>("BUSES"), "BUS".to_string());               
assert_eq!(singular::<_, String>("Buses"), "Bus".to_string());               
assert_eq!(singular::<_, String>("FancyPeople"), "FancyPerson".to_string()); 

Dependencies

~2.1–3MB
~55K SLoC