8000 StringUtil::singularify() does not convert "series" correctly · Issue #16532 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

StringUtil::singularify() does not convert "series" correctly #16532

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
michal-szu opened this issue Nov 12, 2015 · 5 comments
Closed

StringUtil::singularify() does not convert "series" correctly #16532

michal-szu opened this issue Nov 12, 2015 · 5 comments

Comments

@michal-szu
Copy link

I've got problem with propertyAccessor.
I need to get singular form of property with name "DataSeries".
StringUtil::singularify() transfomrs it to "DataSery" but it should be "DataSerie".

Maybe you should do something like doctrine inflector (https://github.com/doctrine/inflector/blob/master/lib/Doctrine/Common/Inflector/Inflector.php).

@thewilkybarkid
Copy link
Contributor

Series is both singular and plural.

@TeLiXj
Copy link
Contributor
TeLiXj commented Nov 20, 2015

Same problem with "Services", singularify transform this word into "Servicious" using the rule for mice-mouse.
This method is really needed in writeProperty method of PropertyAccessor class? If you have a camelized property, why search the singular word? I think this is a source of problems and should be deleted from this class, unless anybody can explain me why use it. Imagine if using other language distinct of English, will be funny...

@peter-gribanov
Copy link
Contributor

I also faced the problem of converting word: series.

Link from StringUtil

http://en.scribd.com/doc/27703164/3271143-List-of-100-Irregular-Plural-Nouns-in-English
Singular -> Plural
series -> series

Agree with the @TeLiXj, name convert is a very dangerous thing. If you convert the parameter name, then make sure that checks for methods with the original name.

@peter-gribanov
Copy link
Contributor

Must also add to the exclusion of the word: news
https://ru.scribd.com/doc/11537236/Singular-Plural-Nouns-Notes

fabpot added a commit that referenced this issue Feb 12, 2016
This PR was merged into the 2.3 branch.

Discussion
----------

Added more exceptions to singularify method

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

Added exceptions for `series`, `news` and `services`.

Commits
-------

f5daa0d Added more exceptions to singularify method
@javiereguiluz
Copy link
Member

Closing it as fixed by #17745.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants
0