Word Pluralization and Conversions from Numbers like 1,2,3,4,5

Anyone knows if standard ruby has this available?

5.en.numwords # => "five"
1.en.numwords # => "one"

This is part of the Linguistics gem, but I wonder why
standard Ruby does not have this available?

To be able to convert "5" to "five" seems useful
everytime I want to output something to the user.

···

--
Posted via http://www.ruby-forum.com/.

Anyone knows if standard ruby has this available?

5.en.numwords # => "five"
1.en.numwords # => "one"

This is part of the Linguistics gem, but I wonder why
standard Ruby does not have this available?

I am guessing that translation and natural language handling are not
considered basic i18n functionality. That makes a whole lot of sense
if you consider that it is complicated and there are usually a lot
different possible approaches. Whichever you put into the core or
standard library you will only help part of the Ruby population.
Using a gem for this does not seem to be such a bad alternative.

To be able to convert "5" to "five" seems useful
everytime I want to output something to the user.

Well, you could create a poor man's version if you feel the gem is too
heavyweight:

NUMBERS =%w[zero one two three four five six seven eight nine]

puts NUMBERS[5]

:wink:

Kind regards

robert

···

On Tue, Dec 25, 2012 at 4:41 AM, Marc Heiler <lists@ruby-forum.com> wrote:

--
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

And English gem.