Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #18802

Re: Eliminate abusive, hostile, indecent text from <textarea>

From Stefan Weiss <krewecherl@gmail.com>
Newsgroups comp.lang.javascript
Subject Re: Eliminate abusive, hostile, indecent text from <textarea>
Date 2013-03-10 11:56 +0100
Organization albasani.net
Message-ID <khhot5$tv0$1@news.albasani.net> (permalink)
References <aq1l3aFa1b8U1@mid.individual.net>

Show all headers | View raw


On 2013-03-09 21:41, Mel Smith wrote:
>     On one of my pages, I have two side-by-side <textarea> tags where users 
> will enter up to 245 chars in each.
> 
>     Onblur from these areas, I wish to scan the input text string for 
> inappropriate phrases, words, abbrevs, etc (e.g., abusive, indecent, hostile 
> text), warn the user, and then replace the forbidden text with 'bleeped-out' 
> text of some sort that the user can edit/repair
> 
>     Any pointers, guidance for this task ??

You're looking for a technical solution to a social problem. Word lists
simply aren't good enough for this task. It's trivially easy to be very
offensive without using foul language ("Glad to hear that your wife got
cancer. I hope she dies a slow and agonizing death", etc). On the other
hand, even apparently obvious naughty words can be harmless, depending
on context (for example, there's a place named "Fucking" in Austria;
tits and boobies are bird species). And then you got all the intentional
misspellings, leet speak, ASCII art genitalia, Unicode trickery, and so on.

Until there's a major breakthrough in AI research (other than Mentifex),
you're going to need an alternate way to report offensive content.
Usually that means letting those who feel offended by a piece of
user-supplied content flag or report it in some way. This, in
combination with a policy about acceptable content and a prominent
disclaimer, should be enough. Moderation of content by other users can
also help, but opens up a whole new can of worms.

Since you asked if there's a prebuilt JS function to bleep offensive
text: nothing like that is built into the language (or browser APIs, to
the best of my knowledge). I'm sure plenty of people have written JS
libraries to filter bad language. Based on my reservations about the
whole concept, I couldn't recommend one, even if I knew any. But if you
want to find out just how well automatic censoring works in practice, go
ahead and try one of those.

- stefan

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Eliminate abusive, hostile, indecent text from <textarea> "Mel Smith" <med_cutout_syntel@aol.com> - 2013-03-09 13:41 -0700
  Re: Eliminate abusive, hostile, indecent text from <textarea> Danny <dann90038@gmail.com> - 2013-03-09 12:58 -0800
    Re: Eliminate abusive, hostile, indecent text from <textarea> "Mel Smith" <med_cutout_syntel@aol.com> - 2013-03-09 16:26 -0700
      Re: Eliminate abusive, hostile, indecent text from <textarea> Danny <dann90038@gmail.com> - 2013-03-09 15:56 -0800
        Re: Eliminate abusive, hostile, indecent text from <textarea> "Mel Smith" <med_cutout_syntel@aol.com> - 2013-03-09 17:22 -0700
  Re: Eliminate abusive, hostile, indecent text from <textarea> "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2013-03-10 00:31 +0100
    Re: Eliminate abusive, hostile, indecent text from <textarea> "Mel Smith" <med_cutout_syntel@aol.com> - 2013-03-09 17:36 -0700
      Re: Eliminate abusive, hostile, indecent text from <textarea> "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2013-03-10 10:48 +0100
  Re: Eliminate abusive, hostile, indecent text from <textarea> John G Harris <niam@jghnorth.org.uk.invalid> - 2013-03-10 10:40 +0000
    Re: Eliminate abusive, hostile, indecent text from <textarea> Wally W. <ww84wa@aim.com> - 2013-03-10 12:33 -0500
      Re: Eliminate abusive, hostile, indecent text from <textarea> "Mel Smith" <med_cutout_syntel@aol.com> - 2013-03-10 11:29 -0700
  Re: Eliminate abusive, hostile, indecent text from <textarea> Stefan Weiss <krewecherl@gmail.com> - 2013-03-10 11:56 +0100
    Re: Eliminate abusive, hostile, indecent text from <textarea> "Mel Smith" <med_cutout_syntel@aol.com> - 2013-03-10 07:51 -0700

csiph-web