-
Notifications
You must be signed in to change notification settings - Fork 965
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
Double Barrel Name conversion #620
Comments
So in TitleCase mode, you expect:
and we get
right? but what should we do for:
We have to define what is a word. TitleCase.com seems to agree with the current implementation. And what if you send "
Also, you dont need to do |
Hey, no I want And yes, if we pass that string it will mess, and hence I am not sure how to implement it better. I just know that my source do not have such random string, but not reliable enough, hence I need someone good to improve it and make it part of this library which is already good. |
ok. You can trust your source but a public library cant. How a string like |
That is why I name it as All purpose of Humanizer is that it make small things easy, it is one of most common and missing thing I found. Maybe you can improve it with regular expression to make transformation of name. Or in your example split it with |
I would personally add these names as an exception
…On Fri, 10 Mar 2017 at 3:01 AM, Sumit Gupta ***@***.***> wrote:
That is why I name it as NameCase, I believe it is up to user to use
properly. This Transformation is not for String but for Name. Having said
It is not intended for sentences but for Fixing Name display on your
project. If we go for sentence it will become a natural language parser and
that is, for me is beyond the scope of this.
All purpose of Humanizer is that it make small things easy, it is one of
most common and missing thing I found. Maybe you can improve it with
regular expression to make converstion. Or in your example split it with '
or - and improve that function specific for Naming Case and not sentences.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#620 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAI1l4qZNhQDH1xPmN-xKKLrerezh-X2ks5rkAYFgaJpZM4MXs-i>
.
|
@hazzik not sure what you mean by putting name as exception. We are taking about a method to transform a name string in proper case for display. Putting data as exception totally destroy the concept of humanizer itself. Idea of this thread request is to make it easier for other developer to format names properly. which |
I mean that you have to have a dictionary with the exception cases (like O'Neil, McDonald, DiCaprio, d'Estaing, etc) First of all, trying to do anything with names is a very bad idea. It shall be displayed as user have entered the name. |
I am sure not many agree with you, Some site allow user to enter name and for design sack and consistency they display them Upper case or lower case or Name Case. And for name like McDonald, well there is no rule about it, some write it as Mcdonald and some as McDonald, but for name like O'Neil or Double Barrel name it is the way of writing. I know it because my client don't like it when I write O'neil in their name or Stuart-smith, and the logic as simple as Camel casing after any special character. My logic works for my use. Just if author of Humanizer find it interesting to improve and add will be good as I am sure there are few project who can use it. |
Because you should stop trying to mess with customers' surnames and let them enter it and display it as is. |
I would say that the only "allowed" (to some degree at least) transformation of customer names is to transform it to all upper case. But even with this "safe" transformation some would not agree that even this is acceptable. |
@hazzik indeed. For example, my last name is |
I like the library but it add a value if you can include Name Casing (I call it like that), along with TitleCase. The idea is to change Double Barrel name and name like
O'Neil
to be properly cased. I wrote a novice function for it using Humanizer itselfIt does both, but I am not sure how to improve it further, my idea is to write it in Regular expression for better results, but for now it works.
The text was updated successfully, but these errors were encountered: