Skip to content
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

Extra comma in Collection list #390

Open
aetaylor opened this issue Mar 3, 2015 · 10 comments
Open

Extra comma in Collection list #390

aetaylor opened this issue Mar 3, 2015 · 10 comments

Comments

@aetaylor
Copy link

aetaylor commented Mar 3, 2015

There appears to be a slight bug in the humanised collections which includes an extra comma:

One, Two, Three, and Four

the comma after Three should not be there.

@darrellnorton
Copy link

It's actually ok to be there. It's called an Oxford comma or serial comma (http://en.wikipedia.org/wiki/Serial_comma). Whether it is included or not depends on a couple factors described in the Wikipedia article.

Since there is no universal decision I do not think it is a bug.

@justin-edwards
Copy link
Contributor

I will admit that I took a slightly opinionated stance in regards to the Oxford comma since, in my experience, it more often reduces ambiguity than introduces it. It could be made optional(and that probably wouldn't take much work after #386), but like I said I was feeling a little opinionated that day.

@hazzik
Copy link
Member

hazzik commented Mar 4, 2015

fychx

@MehdiK
Copy link
Member

MehdiK commented Mar 4, 2015

Thanks for the discussion guys. Closing this thread now.

@MehdiK MehdiK closed this as completed Mar 4, 2015
@hazzik
Copy link
Member

hazzik commented Mar 4, 2015

Actually we need to do a research on usage of serial comma by English speaking country and implement this feature as regional differences: en-US, en-GB, en-AU, en-NZ, etc

@aetaylor
Copy link
Author

aetaylor commented Mar 4, 2015

Hazzik is correct. The unfortunately named 'Oxford' comma is frequently used by Americans but is generally regarded as a gramatical error in British English, although it has it's uses in certain edge-case scenarios. (see: http://www.grammar-monster.com/lessons/commas_in_lists.htm)
Since no-one is going to be truely happy about this it may be better to include an option flag, otherwise us Brits are going to have to continue to re-parse Humanizer's output in order to correct it ;o)

@hazzik hazzik reopened this Mar 4, 2015
@hazzik
Copy link
Member

hazzik commented Mar 4, 2015

I think we need to be able to specify conjunction word, something like this:

new { 1, 2, 3, 4, 5}.Humanize(", and");
new { 1, 2, 3, 4, 5}.Humanize(", or");
new { 1, 2, 3, 4, 5}.Humanize("и");

@MehdiK
Copy link
Member

MehdiK commented Mar 4, 2015

Good point @hazzik. Agreed. We could also provide a configuration point for the separator or CollectionFormatter. If the config and the separator on the method call are both missing, we could then fall back to a collection formatter configured per locale.

@clairernovotny
Copy link
Member

Any updates on this? Is this still a general to-do? Should this be in for 2.0 or vNext?

@hazzik
Copy link
Member

hazzik commented Jan 2, 2016

vNext

@clairernovotny clairernovotny added this to the vNext milestone Jan 2, 2016
@clairernovotny clairernovotny modified the milestones: v2.1, vNext Feb 10, 2016
@clairernovotny clairernovotny modified the milestones: vNext, v2.1 Jun 26, 2016
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

6 participants