View Poll Results: Should we improve the censoring in global?

Voters
316. You may not vote on this poll
  • Yes

    275 87.03%
  • No

    41 12.97%
Page 1 of 17 12311 ... LastLast
Results 1 to 10 of 165

Thread: Fix the censoring in global

  1. #1
    Forum Veteran
    Join Date
    May 2014
    Posts
    1,966

    Fix the chat censoring in global

    Support the cause to improve global chat! Join the group: http://forum.supercell.net/group.php?groupid=2602

    So... In my time playing this wonderful game, I've noticed that the anti-swear system in global seems to be downright useless. It seems to fairly often censor words that aren't even intentionally put there (like between words...). The other problem is that people can easily get around it by using accented letters (I'm pretty sure everyone who has visited global knows what I'm talking about). Thus, I came up with a way to fix it.

    How it works:
    The existing list of swear words is separated into 2 lists: One of "light" words, and another with the typical swear words. The "light" list would contain all of those obscure words that end up just getting in the way. The normal one would have all of the "normal" swear words. The two lists would be censored in different ways:

    The "light" list only censors words if they are in the same word: spaces or punctuation will prevent censoring. (As I said earlier, these words are the ones that just make it harder to write normal messages.

    The other list is like the existing system, but more heavily enforced: It will censor stuff across punctuation marks.
    To put it more simply:
    Light censor is for obscure/ more tame words that more often than not impede conversation.
    Heavy censor is for the truly "bad" words-- f-word, for example.

    Both systems ignore accents, which prevent a giant loophole which is currently in the chat system.

    For example, if "AAAA" was a light swear word, AAAA or AAÀA would be censored, but AA AA or AA.AA wouldn't.
    If it was a (well, I guess "heavy?") swear word, AAAA, AA AA, AAÀA, AA.....AA, and AA$&,]AA would be censored.

    Before anyone says how hard it would be to implement, it isn't. I made a (as far as I can tell) working version of it in about 75 lines of Java code. (Just the base light-heavy-isolate functionality) (Java because that's what SC uses for server stuff).

    The one issue is that (or at least the version I made) may behave erratically in other languages, as I coded it to recognize only English characters as actual letters. But hey--it's a start.


    Edit: According to popular demand, I'm also requesting that many of the obscure words be removed from the list entirely, and most others be put on the "light censor" list
    Last edited by Brenn; August 7th, 2014 at 05:08 PM. Reason: Finished code!

  2. #2
    Forum Veteran
    Join Date
    May 2014
    Posts
    1,966
    So... I wrote an actual program to do the kind of censoring I was envisioning, just to prove that it is possible, and feasible, to implement this new kind of censoring for global chat. I wrote it in Java, because I'm pretty sure that the SC servers are written with Java, and I figured chat stuff was a server thing.

    The things I tested:
    -light censoring as normal word
    -LC with space in middle
    -LC with punctuation in middle
    -HC with accent
    -HC as normal
    -HC with space
    -HC with accent & space
    -HC with periods in middle
    -HC with random non-letters in middle
    -HC spread apart (last thing in string, if you want to see what I mean)
    All worked as intended.


    So without further ado, the 75 lines of source code. It can probably be improved, but I'll leave that to SC if they decide to use it:


    import java.text.Normalizer;
    public class Code {

    public static String[] lightCensor = {"cde"};
    public static String[] heavyCensor = {"auu", "iiv"};

    //For variants: First in row is intended character, following ones are the variants
    //To add new ones (people start using a new variant): Continue the pattern shown
    public static String[][] stringVariants = {
    {"a", "/-\\", "/=\\"},
    {"u", "|_|", "\\_/", "\\./"}
    };
    public static char[][] characterVariants = {
    {'i', 'l', '1', '!'}
    };


    public static void main(String[] args) {

    String s = "/-\\ |_| |_| l1v";
    s = censor(s);
    System.out.println(s);
    }

    public static String replaceStringVariants(String message){
    for (int i = 0; i < stringVariants.length; i++){
    String replaceWith = stringVariants[i][0];
    for(int j = 1; j < stringVariants[i].length; j++){
    message = message.replace(stringVariants[i][j], replaceWith);
    }
    }
    return message;
    }

    public static boolean testIfVariant(char toTest, char testAgainst){
    testAgainst = Character.toLowerCase(testAgainst);
    if (toTest == testAgainst) return true;

    for (int i = 0; i < characterVariants.length; i++){
    if (characterVariants[i][0] == toTest) {

    for (int j = 1; j < characterVariants[i].length; j++){

    if (testAgainst == characterVariants[i][j]){
    return true;

    }
    }
    }
    }
    return false;
    }

    public static String censor(String message){
    message = replaceStringVariants(message);
    //Remove all the variant letters that people use to get around the current system
    String t = Normalizer.normalize(message.toLowerCase(), Normalizer.Form.NFD);
    t = t.replaceAll("\\p{InCombiningDiacriticalMarks}+", "").toLowerCase();

    //The light censor list contains the more obscure/less swear-y words: the ones that frequently can mess up normal messages
    for (String s : lightCensor){//Words in the light censor list are only censored if it appears in 1 word, not across multiple,
    String replaceWith = "";//which lowers the chances of normal messages getting bleeped out.
    for (int i = 0; i < s.length(); i++){
    replaceWith += "*";
    }
    while(t.contains(s)){//The while loop replaces the words with the asterisks.
    int index = t.indexOf(s);
    t = t.substring(0, index) + replaceWith + t.substring(index + replaceWith.length());
    message = message.substring(0, index) + replaceWith + message.substring(index + replaceWith.length());
    }
    }

    //The heavy censor list contains the words you don't want showing up in any way (I think you know what I mean...)
    //It will bleep these words out across spaces, and even non-letters, making it much harder to swear in global chat
    //Note that the use of variant letters (common way to avoid, currently) have already been fixed, so that this will work.
    for (String s : heavyCensor){
    String censored = isolate(t, s);
    while(!censored.equals("")){

    String replace = "";
    for (int i = 0; i < censored.length(); i++)
    replace += "*";

    int index = t.indexOf(censored);
    t = t.substring(0, index) + replace + t.substring(index + replace.length());
    message = message.substring(0, index) + replace + message.substring(index + replace.length());
    censored = isolate(t, s);
    }
    }
    return message;
    }

    public static String isolate(String message, String word){
    int wordIndex = 0;
    String toReturn = "";
    if (message.contains(word))
    return word;

    for (int i = 0; i < message.length() && wordIndex < word.length(); i++){
    char testing = word.charAt(wordIndex);
    char current = message.charAt(i);//Get the two letters
    if (testIfVariant(testing, current)){
    wordIndex++;
    toReturn += current;//If the letters match, great! Add them!
    }
    else if (wordIndex > 0 && testIfVariant(word.charAt(wordIndex - 1), current)){
    toReturn += current;
    }
    else if ((current < 'a' || current > 'z') && (current < 'A' || current > 'Z') && !Character.isDigit(current)){
    if (!toReturn.equals(""))//If it is blank (hasn't found START of word yet), don't add anything
    toReturn += current;
    }
    else{
    wordIndex = 0;//If it is a letter not in the word, reset
    toReturn = "";
    }
    }
    return toReturn;
    }
    }
    Last edited by Brenn; August 7th, 2014 at 05:08 PM. Reason: Finished!

  3. #3
    Forum Veteran
    Join Date
    May 2014
    Posts
    1,966
    (Reserved)
    Last edited by Brenn; July 9th, 2014 at 05:18 AM.

  4. #4
    Forum Hero AxionXD's Avatar
    Join Date
    Apr 2014
    Location
    Dallas, Texas
    Posts
    6,591
    Yea I noticed some weird words being censored, I found the weirdest one yet:

    g 600k

    I swear, type that into Global, it'll get censored. What is that?!

    And the one you see the most common censored....

    I nee(D A Go)od clan.

    I was never sure what a Dago was, but apparently it's a slang name for an Italian?


  5. #5
    Forum Superstar
    Join Date
    Sep 2013
    Posts
    3,875
    Awesome idea. Always hate it when it censors casual conversation.
    Retired

  6. #6
    Centennial Club NuNuHeAd99's Avatar
    Join Date
    Apr 2014
    Location
    Ur moms house
    Posts
    163
    I can't even say my name with an "s" at the end of it... Keanu's Ke-anus Get it???

  7. #7
    Forum Veteran
    Join Date
    May 2014
    Posts
    1,966
    Quote Originally Posted by NuNuHeAd99 View Post
    I can't even say my name with an "s" at the end of it... Keanu's Ke-anus Get it???
    XD
    Sorry, but I don't think that there's any easy way to fix that...

    Clever name, though :)

    By the way, thanks for the support so far!
    Last edited by Brenn; July 9th, 2014 at 04:43 AM.
    Quote Originally Posted by johnnybro1234 View Post
    There were too many words for me to read them all
    Quote Originally Posted by djdiamond66 View Post
    Hey guys please new collector is gem collector all clash of clans playing time is explended sorry its playing its my idea the gemcollector christmas update s guys please work update all clash of clans fans best ideas in he world best startegy game is the Clash of Clans thank you is game game is Perfect

  8. #8
    Centennial Club NuNuHeAd99's Avatar
    Join Date
    Apr 2014
    Location
    Ur moms house
    Posts
    163
    Quote Originally Posted by Brenn View Post
    Sorry, but I don't think that there's any easy way to fix that...

    Clever name, though

    By the way, thanks for the support so far!
    Yea cause it says anus at the end

    Clash
    of Clans

    Main
    , NuNuHeAd99 - TH 9, lvl 103, Elder in xIOWAxCREWx Maxed Defenses

  9. #9
    Forum Veteran
    Join Date
    May 2014
    Posts
    1,966
    Quote Originally Posted by NuNuHeAd99 View Post
    Yea cause it says anus at the end
    Yup.


    Would anyone be interested in actually seeing the code I wrote to do this?
    Quote Originally Posted by johnnybro1234 View Post
    There were too many words for me to read them all
    Quote Originally Posted by djdiamond66 View Post
    Hey guys please new collector is gem collector all clash of clans playing time is explended sorry its playing its my idea the gemcollector christmas update s guys please work update all clash of clans fans best ideas in he world best startegy game is the Clash of Clans thank you is game game is Perfect

  10. #10
    Senior Member
    Join Date
    Mar 2014
    Posts
    290

    yeh

    Quote Originally Posted by Brenn View Post
    Yup.


    Would anyone be interested in actually seeing the code I wrote to do this?
    Yesh plz thatll be good
    Leader of Black Kamikaze King Kazuma trophy record 2756 lvl 96 TH 10 http://forum.supercell.net/showthrea...-Kamikaze-full

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •