Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

[PropertyAccess] Fixed plurals for -ves words #10909

Merged
merged 1 commit into from

4 participants

@csarrazi
Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets -
License MIT
Doc PR -

Fixes singularization for words like caves (cave), staves (staff).

@csarrazi csarrazi Fixed incorrect regular plural for -ves words
Fixes singularization for words like caves (cave), staves (staff).
c7a77c5
@webmozart
Collaborator

Thanks! :+1:

@stof
Collaborator

:+1:

@fabpot
Owner

Thank you @csarrazi.

@fabpot fabpot merged commit c7a77c5 into from
@fabpot fabpot referenced this pull request from a commit
@fabpot fabpot bug #10909 [PropertyAccess] Fixed plurals for -ves words (csarrazi)
This PR was merged into the 2.3 branch.

Discussion
----------

[PropertyAccess] Fixed plurals for -ves words

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Fixes singularization for words like caves (cave), staves (staff).

Commits
-------

c7a77c5 Fixed incorrect regular plural for -ves words
912a72f
@stof
Collaborator

@fabpot this StringUtil pluralization rules should probably be excluded from the "Common Typos" check of fabbot

@csarrazi

@stof @fabpot Not the StringUtil class, but rather the test! :)

@csarrazi csarrazi deleted the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 16, 2014
  1. @csarrazi

    Fixed incorrect regular plural for -ves words

    csarrazi authored
    Fixes singularization for words like caves (cave), staves (staff).
This page is out of date. Refresh to see the latest.
View
4 src/Symfony/Component/PropertyAccess/StringUtil.php
@@ -81,8 +81,8 @@ class StringUtil
// moves (move)
array('sevom', 5, true, true, 'move'),
- // hooves (hoof), dwarves (dwarf), elves (elf), leaves (leaf)
- array('sev', 3, true, true, 'f'),
+ // hooves (hoof), dwarves (dwarf), elves (elf), leaves (leaf), caves (cave), staves (staff)
+ array('sev', 3, true, true, array('f', 've', 'ff')),
// axes (axis), axes (ax), axes (axe)
array('sexa', 4, false, false, array('ax', 'axe', 'axis')),
View
18 src/Symfony/Component/PropertyAccess/Tests/StringUtilTest.php
@@ -38,7 +38,7 @@ public function singularifyProvider()
array('feet', 'foot'),
array('nebulae', 'nebula'),
array('babies', 'baby'),
- array('hooves', 'hoof'),
+ array('hooves', array('hoof', 'hoove', 'hooff')),
array('chateaux', 'chateau'),
array('echoes', array('echo', 'echoe')),
array('analyses', array('analys', 'analyse', 'analysis')),
@@ -64,14 +64,14 @@ public function singularifyProvider()
array('batches', array('batch', 'batche')),
array('bushes', array('bush', 'bushe')),
array('buses', array('bus', 'buse', 'busis')),
- array('calves', 'calf'),
+ array('calves', array('calf', 'calve', 'calff')),
array('circuses', array('circus', 'circuse', 'circusis')),
array('crises', array('cris', 'crise', 'crisis')),
- array('dwarves', 'dwarf'),
- array('elves', 'elf'),
+ array('dwarves', array('dwarf', 'dwarve', 'dwarff')),
+ array('elves', array('elf', 'elve', 'elff')),
array('emphases', array('emphas', 'emphase', 'emphasis')),
array('faxes', 'fax'),
- array('halves', 'half'),
+ array('halves', array('half', 'halve', 'halff')),
array('heroes', array('hero', 'heroe')),
array('hoaxes', 'hoax'),
array('irises', array('iris', 'irise', 'irisis')),
@@ -86,13 +86,15 @@ public function singularifyProvider()
array('plateaux', 'plateau'),
array('poppies', 'poppy'),
array('quizzes', 'quiz'),
- array('scarves', 'scarf'),
+ array('scarves', array('scarf', 'scarve', 'scarff')),
array('spies', 'spy'),
array('stories', 'story'),
array('syllabi', 'syllabus'),
- array('thieves', 'thief'),
+ array('thieves', array('thief', 'thieve', 'thieff')),
array('waltzes', array('waltz', 'waltze')),
- array('wharves', 'wharf'),
+ array('wharves', array('wharf', 'wharve', 'wharff')),
+ array('caves', array('caf', 'cave', 'caff')),
+ array('staves', array('staf', 'stave', 'staff')),
array('wives', 'wife'),
array('ions', 'ion'),
array('bases', array('bas', 'base', 'basis')),
Something went wrong with that request. Please try again.