function pluralize ($word, $exceptions
{
if (array_key_exists$word, $exceptions))
return $exceptions$word];
if (substr_compare$word, 'y', -1, 1)==0) {
if (in_arraysubstr$word, -2, 1), array'a''e''i''o''u''y'))===false)
return substr$word, 0, -1).'ies'
else
return $word's'
}
if (substr_compare$word, 'o', -1, 1)==0) {
if (in_arraysubstr$word, -2, 1), array'a''e''i''o''u'))===false)
return $word'es'
else
return $word's'
}
if (substr_compare$word, 's', -1, 1)==0)
return $word'es'
if (substr_compare$word, 'x', -1, 1)==0)
return $word'es'
if (substr_compare$word, 'z', -1, 1)==0)
return $word'es'
if (substr_compare$word, 'ch', -2, 2)==0)
return $word'es'
if (substr_compare$word, 'sh', -2, 2)==0)
return $word'es'
return $word's'
}