hay that is concise and explicit many thanks
 now i am reading docs about //inflections.rb
i grasp your steps under the heading
"String inflections define new methods on the String class"
where '../inflections.rb' has fifteen methods
your solution shows some neat ways it can be adapted
in our case both numbers and strings are in singular and plural
thankfully the output grammar can be corrected to suit either alternative
this was a hitch that is solved in ruby
it appears quite a fiddly issue more than it really is


On Fri, Feb 8, 2013 at 11:10 AM, Hassan Schroeder <
hassan.schroeder / gmail.com> wrote:

> On Thu, Feb 7, 2013 at 3:40 PM, Timothy Gregory <tigre7t / gmail.com> wrote:
> > on the side-track in case the name has only one character then the word
> > 'character' is usually written as character(s) rather than as an
> apostrophe
> > this visible abbreviation is a valid way to create two options.
> > to write it this way will (s) need to be escaped?
> > for singular and plural to be viable alternatives?
> > can (s) be escaped by either "\(s)" or " " ?
> > puts needs singular and plural pronouns and tense
> > to print 'there is one ,,' or else put 'there are..'
>
> In a pry console, including one Rails file:
>
> 1.9.3 (main):0 > require 'active_support/core_ext/string/inflections'
> => true
> 1.9.3 (main):0 > count = 1
> => 1
> 1.9.3 (main):0 > "there #{'is'.pluralize(count)} #{count}
> #{'character'.pluralize(count)}."
> => "there is 1 character."
> 1.9.3 (main):0 > count = 3
> => 3
> 1.9.3 (main):0 > "there #{'is'.pluralize(count)} #{count}
> #{'character'.pluralize(count)}."
> => "there is 3 characters."
>
> !! oops, that's a surprising omission, but
>
> 1.9.3 (main):0 > ActiveSupport::Inflector.inflections{|inflect|
> inflect.plural "is", "are" }
> ....
> 1.9.3 (main):0 > "there #{'is'.pluralize(count)} #{count}
> #{'character'.pluralize(count)}."
> => "there are 3 characters."
>
> HTH,
> --
> Hassan Schroeder ------------------------ hassan.schroeder / gmail.com
> http://about.me/hassanschroeder
> twitter: @hassan
>
>