Creating a profanity filter for user generated content
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: Creating a profanity filter for user generated content

  1. #1
    Join Date
    Oct 2012
    Posts
    3

    Creating a profanity filter for user generated content

    Hi guys!

    I'm working on a Java project where i need to create a filter for filtering uploaded names.
    The names are uploaded to the db from all over the world, so for-example, i don't want to blacklist a name like "Alassandra" which has "***" in it.

    Would appreciate some guidance, help where to look at, or some algorithm tips for creating my type of filter?

    Regards
    Arvin

  2. #2
    Join Date
    May 2006
    Location
    UK
    Posts
    4,474

    Re: Creating a profanity filter for user generated content

    The first thing is to decide on is the exact rules you want to enforce.

    In the example you gave you clearly won't allow the 3 letter word but will allow it when it's part of another word but what if it is embedded in other characters such as 123xxx456 or xxx.com or *xxx* etc
    BTW when writing this I used the actual word rather than xxx and this site allowed the first example but not the other two.

    I'd start by searching for something like "banned word filter" "bad word lists" etc and see what is available.
    Posting code? Use code tags like this: [code]...Your code here...[/code]
    Click here for examples of Java Code

  3. #3
    Join Date
    Oct 2012
    Posts
    3

    Re: Creating a profanity filter for user generated content

    Yes you're probably right. I have looked for an algorithm/solution for a filter, but feeling a little lost. Anybody having tips on algorithms or api? Would really appreciate it !

  4. #4
    Join Date
    Oct 2012
    Posts
    3

    Re: Creating a profanity filter for user generated content

    Edit:

    Maybe i should just use regex for filtering?

  5. #5
    Join Date
    May 2006
    Location
    UK
    Posts
    4,474

    Re: Creating a profanity filter for user generated content

    Maybe i should just use regex for filtering
    You are confusing implementation details with analysis and design details. How you are going to implement it in code is not relevant at this stage, you need to decide what you are trying to achieve first (Analysis). Then decide on how you will solve the problem (Design) and finally you translate the design to code (Implementation).
    Posting code? Use code tags like this: [code]...Your code here...[/code]
    Click here for examples of Java Code

Posting Permissions

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


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center