If you want code to pluralize a noun, have a look at activesupport/lib/active_support/inflector.rb in the Rails source code.
It might make an interesting code kata because you have to decide on a way to represent some declarative knowledge in whatever language you decide to code in, like the fact that the plural of "rice" is "rice".