Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #18789 > unrolled thread
| Started by | "Mel Smith" <med_cutout_syntel@aol.com> |
|---|---|
| First post | 2013-03-09 13:41 -0700 |
| Last post | 2013-03-10 07:51 -0700 |
| Articles | 13 — 6 participants |
Back to article view | Back to comp.lang.javascript
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
| From | "Mel Smith" <med_cutout_syntel@aol.com> |
|---|---|
| Date | 2013-03-09 13:41 -0700 |
| Subject | Eliminate abusive, hostile, indecent text from <textarea> |
| Message-ID | <aq1l3aFa1b8U1@mid.individual.net> |
Hi:
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 ??
Thank you.
-Mel Smith
[toc] | [next] | [standalone]
| From | Danny <dann90038@gmail.com> |
|---|---|
| Date | 2013-03-09 12:58 -0800 |
| Message-ID | <1cc98e4e-630a-4286-9323-baee74733660@googlegroups.com> |
| In reply to | #18789 |
To Mel Smith So, what are you asking exactly? I mean is obvious you'll have to regex the string, other than that, what do you think you need?
[toc] | [prev] | [next] | [standalone]
| From | "Mel Smith" <med_cutout_syntel@aol.com> |
|---|---|
| Date | 2013-03-09 16:26 -0700 |
| Message-ID | <aq1up4Fc4ghU1@mid.individual.net> |
| In reply to | #18790 |
Danny said:
> So, what are you asking exactly? I mean is obvious you'll have to regex
> the string, other than that, what do you think you need?
>
Hi Danny:
I know I'll have to regex the string and then do something somehow.
But I had hoped there would be some pre-built javascript function that
I could modify for my own needs (editing for north american foul, indecent
and hostile 'english') to create my own personal cleansing function. I
would then like to output a 'clean' string with bleepy chars colored for
easy identiification so my user can quickly clean up his string of
charsacters
So, I guess I'm looking for someone to do all my work for me :((
Correction: my strings max at 254 chars not 245.
-Mel
[toc] | [prev] | [next] | [standalone]
| From | Danny <dann90038@gmail.com> |
|---|---|
| Date | 2013-03-09 15:56 -0800 |
| Message-ID | <3b8f0184-3a55-49a2-9a3d-115818785adb@googlegroups.com> |
| In reply to | #18791 |
To Mel As pointed out by now, getting a wide-spectrum unified version of 'indecent', or 'offensive' can require lots of research which may not yield much filtering in the end, due to fluctuations on their material perception. So I'd think what you need to do is to identify the niche or market of demographics that will be using those 'textareas', and then narrow it down to that market alone. And also bear in mind that, 'offensive' language in itself has no intrinsic offensive meaning, it's the context in which it's used that makes it offensive. So folks can use abusive language without using 'offensive' words as well, and those semantics, Regex can't quite pick up. I think the most you can do is remove the most commonly used 'offensive' words. Make a list, probably won't be too long, and regex that.
[toc] | [prev] | [next] | [standalone]
| From | "Mel Smith" <med_cutout_syntel@aol.com> |
|---|---|
| Date | 2013-03-09 17:22 -0700 |
| Message-ID | <aq222fFcprvU1@mid.individual.net> |
| In reply to | #18793 |
Danny said:
I think the most you can do is remove the most commonly used 'offensive'
words. Make a list, probably won't be too long, and regex that.
Hi Danny:
Yes, I have to do that at the outset.
Thank you.
-Mel
[toc] | [prev] | [next] | [standalone]
| From | "Evertjan." <exxjxw.hannivoort@inter.nl.net> |
|---|---|
| Date | 2013-03-10 00:31 +0100 |
| Message-ID | <XnsA17F565D74E7eejj99@194.109.133.133> |
| In reply to | #18789 |
Mel Smith wrote on 09 mrt 2013 in comp.lang.javascript: > 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 ?? Impossible. What is inappropriate or indecent to you, can be quite appropriate or decent to me. Even if you take only yourself as a guide, are you an expert on what you think to be so in the sense that you can make an inclusive list of what to expect? Perhaps neural network code or babesian code could learn from your reactions of real world experiences in due time [10 years or so?] What abbreviations are offensive btw, surely that depends on context. ["btw" is value added tax over here, in some contexts, that is offensive] Methinks "abbrevs" is unneccesarily offensive in a sexual and racist way, do you? -- Evertjan. The Netherlands. (Please change the x'es to dots in my emailaddress)
[toc] | [prev] | [next] | [standalone]
| From | "Mel Smith" <med_cutout_syntel@aol.com> |
|---|---|
| Date | 2013-03-09 17:36 -0700 |
| Message-ID | <aq22slFcuqaU1@mid.individual.net> |
| In reply to | #18792 |
Evertjan said:
> What is inappropriate or indecent to you,
> can be quite appropriate or decent to me.
>
But, I'm the one who decides in this case.
> Even if you take only yourself as a guide,
> are you an expert on what you think to be so
> in the sense that you can make an
> inclusive list of what to expect?
Yes -- I'm running the show *this* time, and I know my intended
audience (who are restricted to approx 12,000 older sportsmen of a
particular sport). And I also know the language/comments I'll accept -- for
public or private viewing.
> What abbreviations are offensive btw, surely that depends on context.
>
Currently, S.O.B. is not as offensive as it was years ago -- so, I'll
allow it for one of the <textarea>s (the 'private' one) but not the other
(the 'public' one)
> ["btw" is value added tax over here, in some contexts, that is offensive]
>
> Methinks "abbrevs" is unneccesarily offensive in a sexual and racist way,
> do you?
"abbrevs" -- sexual ??, racist ?? (no comprende)
-Mel
[toc] | [prev] | [next] | [standalone]
| From | "Evertjan." <exxjxw.hannivoort@inter.nl.net> |
|---|---|
| Date | 2013-03-10 10:48 +0100 |
| Message-ID | <XnsA17F6DE05DF55eejj99@194.109.133.133> |
| In reply to | #18798 |
Mel Smith wrote on 10 mrt 2013 in comp.lang.javascript: > "abbrevs" -- sexual ??, racist ?? (no comprende) Exactly, that is the response I sort of expected. You don't understand the innuendo, as it is near impossible to comprendo for an audience outsider, no? Over here it is felt very offensive to use abreviations in communication outside the audience, where it is accepted usage. -- Evertjan. The Netherlands. (Please change the x'es to dots in my emailaddress)
[toc] | [prev] | [next] | [standalone]
| From | John G Harris <niam@jghnorth.org.uk.invalid> |
|---|---|
| Date | 2013-03-10 10:40 +0000 |
| Message-ID | <KgNNkCGZMGPRFwlK@J.A830F0FF37FB96852AD08924D9443D28E23ED5CD> |
| In reply to | #18789 |
In message <aq1l3aFa1b8U1@mid.individual.net>, Mel Smith wrote: >Hi: > > On one of my pages, I have two side-by-side <textarea> tags where users >will enter up to 245 chars in each. In spite of the Netscape usage, a tag is just the bit from < to >. An element is everything from the start tag to the matching end tag and everything in between, so it's the *elements* that your users will be changing. > 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 ?? A warning from the past :- Many, many, years ago there was a computer terminal in the Science Museum in London, UK, that was for use by visiting school children. The computer it was connected to was programmed to ignore rude words entered by the children. One day, the teachers were horrified to see it printing the file of all the rude words that were to be ignored :-( In your case, the rude words would be in the HTML file, which can be seen by doing View Source or equivalent. John -- John Harris
[toc] | [prev] | [next] | [standalone]
| From | Wally W. <ww84wa@aim.com> |
|---|---|
| Date | 2013-03-10 12:33 -0500 |
| Message-ID | <7egpj8h262j0gc299ksisnb8thpm1dlkj4@4ax.com> |
| In reply to | #18800 |
On Sun, 10 Mar 2013 10:40:25 +0000, John G Harris wrote: >In message <aq1l3aFa1b8U1@mid.individual.net>, Mel Smith wrote: >>Hi: >> >> On one of my pages, I have two side-by-side <textarea> tags where users >>will enter up to 245 chars in each. > >In spite of the Netscape usage, a tag is just the bit from < to >. An >element is everything from the start tag to the matching end tag and >everything in between, so it's the *elements* that your users will be >changing. > > >> 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 ?? > >A warning from the past :- > >Many, many, years ago there was a computer terminal in the Science >Museum in London, UK, that was for use by visiting school children. The >computer it was connected to was programmed to ignore rude words entered >by the children. One day, the teachers were horrified to see it >printing the file of all the rude words that were to be ignored :-( > >In your case, the rude words would be in the HTML file, which can be >seen by doing View Source or equivalent. Which is why attempting this in javacript is funny. The rude words will be visible to content filters in the workplaces of the "intended audience" mentioned in another post. In addition to creating issues with their employers for the users of your site, content filters may ban your site entirely. Getting your site banned is one way to achieve your goal of not receiving posts with rude words. Be sure to spice up the list for greatest notice by content filters.
[toc] | [prev] | [next] | [standalone]
| From | "Mel Smith" <med_cutout_syntel@aol.com> |
|---|---|
| Date | 2013-03-10 11:29 -0700 |
| Message-ID | <aq41pdFq32rU1@mid.individual.net> |
| In reply to | #18805 |
Wally said:
>>In your case, the rude words would be in the HTML file, which can be
>>seen by doing View Source or equivalent.
>
> Which is why attempting this in javacript is funny.
>
> The rude words will be visible to content filters in the workplaces of
> the "intended audience" mentioned in another post.
>
> In addition to creating issues with their employers for the users of
> your site, content filters may ban your site entirely.
>
> Getting your site banned is one way to achieve your goal of not
> receiving posts with rude words.
>
> Be sure to spice up the list for greatest notice by content filters.
>
Hi Wally:
Yes, I guess it masy be easier to implement the regex on my server
side -- which I can do easily. Probably a better idea.
Thanks
-Mel
[toc] | [prev] | [next] | [standalone]
| From | Stefan Weiss <krewecherl@gmail.com> |
|---|---|
| Date | 2013-03-10 11:56 +0100 |
| Message-ID | <khhot5$tv0$1@news.albasani.net> |
| In reply to | #18789 |
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
[toc] | [prev] | [next] | [standalone]
| From | "Mel Smith" <med_cutout_syntel@aol.com> |
|---|---|
| Date | 2013-03-10 07:51 -0700 |
| Message-ID | <aq3kviFn4i2U1@mid.individual.net> |
| In reply to | #18802 |
Stefan said:
> 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.
Hi Stefan:
O.k., I'll go googling for a pre-built JS abusive language filter and
see what I can find.
Thank you and the responders for the hints, warnings, and mild derision
-Mel
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.javascript
csiph-web