This project is archived and is in readonly mode.
Add "a"/"an" inflector - indefinitize()
-
Yaroslav Markin
Could you please pastie a couple of examples — where do you use this in your code, does it really help a lot?
Mixed feelings here, maybe some kind of I18n support required?
-
Troy
The case I've encountered is string-ifying a model instance as part of a phrase/sentence: http://pastie.org/458977
It's more useful for displaying complete ideas -- step-by-step instructions, forms where model names aren't sufficient prompts (less savvy users), or when visitors search for lots of different words (search engine awareness).
I agree about the I18n support concern.
-
Ryan Bigg
This is too finnicky a change: http://en.wikipedia.org/wiki/A_a...
How do you test for words with a silent H? You would have to compile a list of these words. I think you should implement it where you need it, perhaps make it a plugin.
-1
-
Troy
IMO, you don't -- no test for sounds, just make clear what it does and doesn't do. It's a 95%+ solution, but failures are predictably obvious ("a herb") and deterministic. The 100% solution, if any, should be a plugin for the reasons you list.
-
Troy
Will attach another patch to support extensions for special cases (ie, herb), the same way that a few other inflection methods do.
-
Troy
I haven't made time for it, so it doesn't make sense for anyone else to. Feel free to mark as invalid - I would but can't.
-
José Valim
- State changed from new to invalid
