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
As an improvement, you could use rules that generate multiple possibilities and then look up the results in a dictionary to weed out impossible options.
For example replace -ies with -y and -ie. Pies becomes Py and Pie. Only one of those is in the dictionary, so choose that one.
Perhaps you can even find a dictionary with frequency information and select the most common word you generate.
If you combine this with an ordered list of rules that covers a few exceptions, you might get pretty good accuracy.