Expand description
Rust package to pluralize or singularize any word based on a count inspired on pluralize NPM package.
It will keep plurals are plurals if the count given is not 1, either way, it is going to keep the singular form if the count given is 1
§Example
use pluralizer::pluralize;
fn main() {
// It can convert to plural
println!("{}", pluralize("House", 2, true)); // 2 Houses
// But also can convert to singular
println!("{}", pluralize("Houses", 1, true)); // 1 House
// And keep singularization if needed
println!("{}", pluralize("House", 1, false)); // House
// Or keep pluralization
println!("{}", pluralize("Houses", 2, false)); // Houses
}
Enums§
- Uncountable
Rule - Uncountable rule struct
Functions§
- add_
irregular_ rule - Add an irregular word definition.
- add_
plural_ rule - Add a pluralization rule to the collection.
- add_
singular_ rule - Add a singularization rule to the collection.
- add_
uncountable_ rule - Add an uncountable word rule.
- pluralize
- Pluralize or singularize a word based on the passed in count.