Log in

No account? Create an account

Previous Entry Share Next Entry
Looking for a word
jducoeur wrote in querki_project
I really do owe this journal an update on all the stuff that's being added -- as expected, getting the wedding invites out the door (which is slowly starting, but only a few so far) is forcing me to add lots of new features. It's hectic but exciting, as we move from "Insufficient" to "Sufficient to do something real". (Following which we will progress to "Adequate to daily use" and, with any luck, "Good" in a few months.)

Here's one looking for a quick opinion, since I just discovered that I need to add it today. I need to add a function that returns the correct word -- singular or plural -- depending on how many things are in the received list. This is a pretty common problem, but to give the immediate example, say that an Invitee has an optional list of Children. I need to write something like:
Your [[Children -> __thingy("Child is", "Children are")]] ...
What is the right name for function _thingy(), which chooses the first parameter if the field is singular, the second if it is plural? (Note that parameters can be anything; I just suspect that text will be the most common usage.)

Obviously, I can do something horribly obvious like _singularOrPlural() if need be. But I have a feeling that there's a correct word out there, so suggestions would be welcomed...

  • 1

Some ideas, with links to wikipedia pages for traversing

Re: Some ideas, with links to wikipedia pages for traversing

I like quantify.

Re: Some ideas, with links to wikipedia pages for traversing

Interesting and relevant links -- thanks! The article on plurality, in particular, is a useful reminder that the nature of this probably is somewhat language-specific, and we may need more general solutions down the road.

The word plurality itself doesn't feel quite right -- it doesn't verb the parameters quite the way I expect. But it does suggest that mindways's suggestion of _pluralize() might be correct...

  • 1