I\'m preparing some table names for an ORM, and I want to turn plural table names into single entity names. My only problem is finding an algorithm that does it reliably. He
I'm sure you can google to find plenty of libs that do this.
But if you feel like coding, you could try the reverse process: start with singular words of dictionary (download free ones, used by aspell or whatever), use pluralization rule; collect mappings and switch the direction. For "type" you would pluralize to "types", and reverse mapping would work as expected. While there are exceptions here too it is slightly easier to reliably pluralize things. I did this a while back (in mid 90s... :-) ), for an online game (a MUD), where descriptions for multiple identical items were concatenatd, and automatic pluralization was needed.
Also: given that it's finite number of tables you could just use simplest algorithm, get raw output, eyeball it and fix error cases manually. :-)