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

前端 未结 1 1121
伪装坚强ぢ
伪装坚强ぢ 2021-02-07 23:47

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 ru

1条回答
  •  别那么骄傲
    2021-02-08 00:19

    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".

    0 讨论(0)
提交回复
热议问题