Skip to content

Commit

Permalink
bug #33571 [Inflector] add support 'see' to 'ee' for singularize 'fee…
Browse files Browse the repository at this point in the history
…s' to 'fee' (maxhelias)

This PR was merged into the 3.4 branch.

Discussion
----------

[Inflector] add support 'see' to 'ee' for singularize 'fees' to 'fee'

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | - <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | - <!-- required for new features -->
<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.

Additionally (see https://symfony.com/roadmap):
 - Always add tests and ensure they pass.
 - Never break backward compatibility (see https://symfony.com/bc).
 - Bug fixes must be submitted against the lowest maintained branch where they apply
   (lowest branches are regularly merged to upper ones so they get the fixes too.)
 - Features and deprecations must be submitted against branch 4.4.
 - Legacy code removals go to the master branch.
-->
I don't know if this is considered a bug or a new feature ? Tell me if I need to change target branch

This PR improves the singularization of words such as "trees", "employees" or "fees"

Commits
-------

45b4edc [Inflector] add support 'see' to 'ee' for singularize 'fees' to 'fee'
  • Loading branch information
fabpot committed Sep 13, 2019
2 parents d6855d4 + 45b4edc commit cac27b2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/Symfony/Component/Inflector/Inflector.php
Expand Up @@ -124,6 +124,9 @@ final class Inflector
// bureaus (bureau)
['suae', 4, false, true, 'eau'],

// fees (fee), trees (tree), employees (employee)
['see', 3, true, true, 'ee'],

// roses (rose), garages (garage), cassettes (cassette),
// waltzes (waltz), heroes (hero), bushes (bush), arches (arch),
// shoes (shoe)
Expand Down
8 changes: 5 additions & 3 deletions src/Symfony/Component/Inflector/Tests/InflectorTest.php
Expand Up @@ -38,7 +38,7 @@ public function singularizeProvider()
['bases', ['bas', 'base', 'basis']],
['batches', ['batch', 'batche']],
['beaux', 'beau'],
['bees', ['be', 'bee']],
['bees', 'bee'],
['boxes', 'box'],
['boys', 'boy'],
['bureaus', 'bureau'],
Expand Down Expand Up @@ -68,7 +68,9 @@ public function singularizeProvider()
['echoes', ['echo', 'echoe']],
['elves', ['elf', 'elve', 'elff']],
['emphases', ['emphas', 'emphase', 'emphasis']],
['employees', 'employee'],
['faxes', 'fax'],
['fees', 'fee'],
['feet', 'foot'],
['feedback', 'feedback'],
['foci', 'focus'],
Expand Down Expand Up @@ -139,14 +141,14 @@ public function singularizeProvider()
['teeth', 'tooth'],
['theses', ['thes', 'these', 'thesis']],
['thieves', ['thief', 'thieve', 'thieff']],
['trees', ['tre', 'tree']],
['trees', 'tree'],
['waltzes', ['waltz', 'waltze']],
['wives', 'wife'],

// test casing: if the first letter was uppercase, it should remain so
['Men', 'Man'],
['GrandChildren', 'GrandChild'],
['SubTrees', ['SubTre', 'SubTree']],
['SubTrees', 'SubTree'],

// Known issues
//['insignia', 'insigne'],
Expand Down

0 comments on commit cac27b2

Please sign in to comment.