Skip to content

[String][EnglishInflector] Pluralize on words ending with -on mostly wrong #54611

@DesLynx

Description

@DesLynx

Symfony version(s) affected

5.4 +

Description

When using the EnglishInflector of the String component to pluralize words ending with -on the results are mainly wrong because of the follwing rule in the SINGULAR_MAP:

        // bacteria (bacterium), criteria (criterion), phenomena (phenomenon)
        ['no', 2, true, true, 'a'],

This -on rule is not valid in most of the cases. The rule works for foreign (mainly greek) words. This is an irregular case not a standard.

We can already see 3 other rules for words ending in -pon, -son and -con.

How to reproduce

// First, run "composer require symfony/string"
// Then, execute this file:
<?php
require_once __DIR__.'/vendor/autoload.php';
use Symfony\Component\String\Inflector\EnglishInflector;

// returns "butta" instead of "buttons"
echo (new EnglishInflector())->pluralize('button');

Possible Solution

I'm not an english native-speaker nor an expert of english grammar but I think that it would be better to have a rule dedicated to the foreign word ending in -on, phenomenon and criterion (and maybe others) + a generic rule for words ending in -on.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy