Page 1 of 1
Making plurals singular?
Posted: Tue Aug 15, 2006 8:34 pm
by Mr Tech
Is it possible to make a plural (e.g: surfers) into a singular work (e.g: surfer)? And if the word is already singular, the script doesn't do anything.
Posted: Tue Aug 15, 2006 8:41 pm
by feyd
Sure, it's possible. I have no drive to try doing it myself though.

Posted: Tue Aug 15, 2006 9:16 pm
by Mr Tech
Any idea what php function would do this? Or is it more complex?
Posted: Tue Aug 15, 2006 9:19 pm
by Luke
you could do some sort of regex, but then you'd have to think of all the ways that a word can be plural. Some words end in ies, some in s, some in es, some don't even end in an s at all. That would be a pretty crazy regex. I'm kind of curious how this could be accomplished too.
Posted: Tue Aug 15, 2006 9:21 pm
by RobertGonzalez
I think that is more logic than regex. I also think you are tackling an enormous mountain of anguish and pain if you try to do this. Just my $0.02.
Posted: Tue Aug 15, 2006 9:38 pm
by Luke
sounds fun!

Posted: Tue Aug 15, 2006 10:12 pm
by Ambush Commander
I'm sure with a set of unit tests you could get something reasonably accurate.