You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Singularize() is a near-impossible task because inflector can't distinguish context. e.g. it doesn't know if a word is a pronoun, noun, verb etc. Or which context our application will prefer. Should "Skies" become "Sky" or "Ski"?
It also just gets some things plain wrong: "caves' => "cafe", "Is" => "I", "His" => "Hi"
(In fact, the rule changing *-ves should be abolished and special cases for leaves,knives etc be added ... I think the exceptions to the rule are more common the the rule ;) I'll add another issue.)
It would be great if we could add our own rules so we can customize inflector behaviour. We add the rules that are for our circumstances and when inflector calls Singularize() it checks our custom rules first, before using the built-in rules.
Thanks for great lib.
Singularize()
is a near-impossible task because inflector can't distinguish context. e.g. it doesn't know if a word is a pronoun, noun, verb etc. Or which context our application will prefer. Should "Skies" become "Sky" or "Ski"?It also just gets some things plain wrong: "caves' => "cafe", "Is" => "I", "His" => "Hi"
(In fact, the rule changing *-ves should be abolished and special cases for leaves, knives etc be added ... I think the exceptions to the rule are more common the the rule ;) I'll add another issue.)
It would be great if we could add our own rules so we can customize inflector behaviour. We add the rules that are for our circumstances and when inflector calls
Singularize()
it checks our custom rules first, before using the built-in rules.e.g.
Edit: Here's an example of some Singularize() issues on the Go Playground
The text was updated successfully, but these errors were encountered: