Censoring words

This is a discussion on Censoring words within the C++ Programming forums, part of the General Programming Boards category; I want to make a censor type program that checks to see if the word is a "bad" word, and ...

  1. #1
    For Narnia! Sentral's Avatar
    Join Date
    May 2005
    Location
    Narnia
    Posts
    719

    Censoring words

    I want to make a censor type program that checks to see if the word is a "bad" word, and censor it with either asterisks or a phrase of some sort. I know how to check the words and such, but I have a very odd question! In order for this to work I will need to add these bad words to a "bad words file" and then the program will compare. For this bad word file, I will need to think of every bad word I can, correct?! It has to be able to change any badword, so, anyone have a bad word list or something I can reference?

  2. #2
    pwns nooblars
    Join Date
    Oct 2005
    Location
    Portland, Or
    Posts
    1,094
    go to a linux channel and spam that Windows is better... you will get your list.

  3. #3
    For Narnia! Sentral's Avatar
    Join Date
    May 2005
    Location
    Narnia
    Posts
    719
    Haha! Good idea...but I seriously need sometype of list since I can't think of that many words!

  4. #4
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    >For this bad word file, I will need to think of every bad word I can, correct?!
    How do you know a word you think is bad, other people think is bad as well? How do you know that a word you think is fine, other people won't find terribly offensive? Might it be a better idea to let the users of your program define the list? Perhaps provide a nice interface for adding, removing, and searching for words in the dictionary of bad words?
    My best code is written with the delete key.

  5. #5
    The superhaterodyne twomers's Avatar
    Join Date
    Dec 2005
    Location
    Ireland
    Posts
    2,262
    Perhaps, if you're adventerous, if you wanted to sensor, for example, Ass, you could make something to sensor a$$ ...

  6. #6
    For Narnia! Sentral's Avatar
    Join Date
    May 2005
    Location
    Narnia
    Posts
    719
    Yeah, good idea. Better to let the end user add things, right? I will probably just list words that are pretty obviously rude, and let the user add more. Perhaps reading from a text or config file will do the trick nicely, and it will be easy to add/remove words, simply by editing and saving the file. Sounds like it would work!

    EDIT- @twomers- Heh, that's a little more work! I would have to figure out another word to replace each existing bad word, and what if the user added another bad word that doesn't have an alternative censor?
    Last edited by Sentral; 08-03-2006 at 07:15 PM.

  7. #7
    The superhaterodyne twomers's Avatar
    Join Date
    Dec 2005
    Location
    Ireland
    Posts
    2,262
    Well, what I mean is that you could shuffle through the string of words for the regular letters, then replace all the S's in memory with $'s. That way you don't have to think about it, the program does it foryou. It would be harder than the basic, but I think it would be a good idea!

    What to replace them with? I'd go for ***'s, or perhaps random letters, or places in the world, or kinds of roses. Anything!

  8. #8
    Registered User whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    7,656
    If you want effective censoring consider what this ........ing board does, or just remove the words from the input string entirely, as if they were never typed.

  9. #9
    The superhaterodyne twomers's Avatar
    Join Date
    Dec 2005
    Location
    Ireland
    Posts
    2,262
    I think Roses are better - there are millions

  10. #10
    Moderately Rabid Decrypt's Avatar
    Join Date
    Feb 2005
    Location
    Milwaukee, WI, USA
    Posts
    300
    You really do like hiding things, don't you twomers...
    There is a difference between tedious and difficult.

  11. #11
    The superhaterodyne twomers's Avatar
    Join Date
    Dec 2005
    Location
    Ireland
    Posts
    2,262
    Quote Originally Posted by Decrypt
    You really do like hiding things, don't you twomers...
    I'mttakinghthataasnakcomplements


    EDIT - It was the link, right?
    Last edited by twomers; 08-03-2006 at 07:43 PM.

  12. #12
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,435
    Quote Originally Posted by Sentral
    Yeah, good idea. Better to let the end user add things, right? I will probably just list words that are pretty obviously rude, and let the user add more. Perhaps reading from a text or config file will do the trick nicely, and it will be easy to add/remove words, simply by editing and saving the file. Sounds like it would work!
    Depends on the kind of control you want to give the user. If you want the user to decide himself what he wants to see or not, then it is fine. However, if one user choice may affect what other users see, then you may want to try a different approach.

    You may have a main dictionary file with words you know are bad. This one is really not that hard to build. Unless you lived under a rock all your life Then you have a voting-system-type-of-thing. Users add words to a proposals file and each vote on that word increases its... acidic nature. You then decide how many votes are needed for the word to be placed on the main dictionary.
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  13. #13
    Registered User
    Join Date
    Jul 2006
    Posts
    27
    I could give you 25 of the top of my head.. and if u want another 15 in spanish and french and german

  14. #14
    Registered User
    Join Date
    Aug 2005
    Posts
    1,267
    The American Heritage Dictionary does not exclude words just because they are considered vulgar -- you can look them up at http://www.bartleby.com/61/

  15. #15
    The superhaterodyne twomers's Avatar
    Join Date
    Dec 2005
    Location
    Ireland
    Posts
    2,262
    Use google! I think the board may have a problem with posting, no matter how, a 1 MB list of swear words


    EDIT - I think it would be easier, faster and more accurate if you just made your program change all 4 letter words into dots, stars etc

Page 1 of 2 12 LastLast
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Seg Fault in Compare Function
    By tytelizgal in forum C Programming
    Replies: 1
    Last Post: 10-25-2008, 03:06 PM
  2. seg fault at vectornew
    By tytelizgal in forum C Programming
    Replies: 2
    Last Post: 10-25-2008, 01:22 PM
  3. Problem with malloc() and sorting words from text file
    By goron350 in forum C Programming
    Replies: 11
    Last Post: 11-30-2004, 09:01 AM
  4. New Theme
    By XSquared in forum A Brief History of Cprogramming.com
    Replies: 160
    Last Post: 04-01-2004, 07:00 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21