Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the groups of four dashes in the .NET reference source code?

I was browsing the source of the PluralizationService when I noticed something odd. In the class there are a couple of private dictionaries reflecting different pluralisation rules. For example:

    private string[] _uninflectiveWordList =
        new string[] { 
            "bison", "flounder", "pliers", "bream", "gallows", "proceedings", 
            "breeches", "graffiti", "rabies", "britches", "headquarters", "salmon", 
            "carp", "----", "scissors", "ch----is", "high-jinks", "sea-bass", 
            "clippers", "homework", "series", "cod", "innings", "shears", "contretemps", 
            "jackanapes", "species", "corps", "mackerel", "swine", "debris", "measles", 
            "trout", "diabetes", "mews", "tuna", "djinn", "mumps", "whiting", "eland", 
            "news", "wildebeest", "elk", "pincers", "police", "hair", "ice", "chaos",
            "milk", "cotton", "pneumonoultramicroscopicsilicovolcanoconiosis",
            "information", "aircraft", "scabies", "traffic", "corn", "millet", "rice", 
            "hay", "----", "tobacco", "cabbage", "okra", "broccoli", "asparagus", 
            "lettuce", "beef", "pork", "venison", "mutton",  "cattle", "offspring", 
            "molasses", "shambles", "shingles"};

What are the groups of four dashes in the strings? I did not them see handled in the code, so they're not some kind of a template. The only thing I can think of is that those are censored expletives ('ch----is' would be 'chassis'), which in this case is actually hurting the readability. Did anyone else come across this? If I were to be interested in the actual full list, how would I view it?

like image 596
Emmit Avatar asked Nov 23 '15 14:11

Emmit


1 Answers

From using Reflector to look at the decompiled code I can verify that the compiled version doesn't have "----" in there and it does indeed seem to be some kind of censorship somewhere along the way. The decompiled code has this in the constructor:

this._uninflectiveWordList = new string[] { 
    "bison", "flounder", "pliers", "bream", "gallows", "proceedings", "breeches", "graffiti", "rabies", "britches", "headquarters", "salmon", "carp", "herpes", "scissors", "chassis", 
    "high-jinks", "sea-bass", "clippers", "homework", "series", "cod", "innings", "shears", "contretemps", "jackanapes", "species", "corps", "mackerel", "swine", "debris", "measles", 
    "trout", "diabetes", "mews", "tuna", "djinn", "mumps", "whiting", "eland", "news", "wildebeest", "elk", "pincers", "police", "hair", "ice", "chaos", 
    "milk", "cotton", "pneumonoultramicroscopicsilicovolcanoconiosis", "information", "aircraft", "scabies", "traffic", "corn", "millet", "rice", "hay", "hemp", "tobacco", "cabbage", "okra", "broccoli", 
    "asparagus", "lettuce", "beef", "pork", "venison", "mutton", "cattle", "offspring", "molasses", "shambles", "shingles"
 };

As you can see the censored words are "herpes", "chassis" and "hemp" (if I've followed along correctly). None of which I personally think need censoring which suggests it is some kind of automated system doing it. I would assume that the original source has them in rather than them being added in some kind of precompile merge (if nothing else because "----" really isn't enough for anything to say what it should be replaced with). I'd imagine for some reason the reference website gets them censored.

Hans Passant also in comments linked to an answer to a very similar question: What does ----s mean in the context of StringBuilder.ToString()? . This explains that "The source code for the published Reference Source is pushed through a filter that removes objectionable content from the source".

like image 139
Chris Avatar answered Nov 15 '22 12:11

Chris