Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"equipment" vs "Equipment" #8

Open
CrownedPhoenix opened this issue Oct 13, 2022 · 0 comments
Open

"equipment" vs "Equipment" #8

CrownedPhoenix opened this issue Oct 13, 2022 · 0 comments

Comments

@CrownedPhoenix
Copy link

CrownedPhoenix commented Oct 13, 2022

import InflectorKit

let inflector = StringInflector.default
inflector.addPluralRule(#"^(equipment)$"#, replacement: #"$1s"#)

for singular in ["Equipment", "equipment"] {
    print("\(singular) → \(singular.pluralized)")
}
/*
Prints:
Equipment → Equipments
equipment → equipment
*/

Looks like it's because there's an uncountable rule in the default inflector that isn't being overridden/superseded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant