Inflector::singularize() issue when word ends in `ss`

Hello, I am new to CakePHP [using 4.3], but have 20 years exp. with PHP.

I was working with Inflector, and using the sandbox

https://sandbox.dereuromark.de/sandbox/inflector?string=boss

And found that if a word ends in ss and singularize() is run on it, it removes the second s. boss becomes bos. My understanding is that in the English language when a word ends in s, the plural is that word +es. That ss at the end of a word is always the singular.

If that is correct, I believe Inflector is doing it incorrectly.

I saw this

https://book.cakephp.org/4/en/core-libraries/inflector.html#loading-custom-inflections

Could someone assist me in making a custom rule for this, or perhaps already has a custom rule they could share?

Thanks in advance

Without offering to help I can advise that English is stupider than that. As a rule that works but there are many exceptions which may need to be taken into account (if they aren’t already).
Like 1 octopus, 2 octopii.
1 sheep, 2 sheep.

Then it gets stupider, like virus - if it’s a biological virus the plural is virii, but if we’re talking about computer virus then its viruses. And a mouse. The rodent plural is mice, the computer hardware device is mouses. (1 die, 2 dice.)

Then there’s fish… 1 fish, 2 fish - but, if you’re talking about 2 fish of different fish species then its 2 fishes.

That is English, but I think American English (where these rules have been simplified) is more logical - at least, cleaner; less Latin!

Only a grammar nazi (can I say that?) would care - I’m just preempting them!


Edit: Apologies, I see the title refers to words ending in SS - but instead of deleting my reply I’ll leave it just in case its remotely useful to anyone. Re-reading it seems I’m just stating the obvious, but I guess better to hear something twice than not at all.

The inflector has some rules about how to deal with normal situations, and a bunch of exceptions, but I think it’s all based on the expectation that you’ll only be passing plural words to it. In other words, it doesn’t try to detect whether what it gets is already singular, it just assumes it’s plural and tries its best to make it singular.