in reply to array of MySQL data for substitution

On a more general level of a "swearword filter", you will want to make your regex case-insensitive and avoid the substitution of "swearwords" which are part of "good" words.

If "ass" is a swearword, you probably will not want "assistant" to become "****istant".

And what will happen to a treatise about any of several hoofed mammals of the genus Equus, resembling and closely related to the horses but having a smaller build and longer ears, and including the domesticated donkey?

Would you also want to apply censorship to the Holy Scripture?

Of the domesticated species we read of,

  1. The she ass (Heb. 'athon), so named from its slowness (Gen. 12:16; 45:23; Num. 22:23; 1 Sam. 9:3).
  2. The male ass (Heb. hamor), the common working ass of Western Asia, so called from its red colour. Issachar is compared to a strong ass (Gen. 49:14). It was forbidden to yoke together an ass and an ox in the plough (Deut. 22:10).
  3. The ass's colt (Heb. 'air), mentioned Judg. 10:4; 12:14. It is rendered "foal" in Gen. 32:15; 49:11. (Comp. Job 11:12; Isa. 30:6.) The ass is an unclean animal, because it does not chew the cud (Lev. 11:26. Comp. 2 Kings 6:25). Asses constituted a considerable portion of wealth in ancient times (Gen. 12:16; 30:43; 1 Chr. 27:30; Job 1:3; 42:12). They were noted for their spirit and their attachment to their master (Isa. 1:3). They are frequently spoken of as having been ridden upon, as by Abraham (Gen. 22:3), Balaam (Num. 22:21), the disobedient prophet (1 Kings 13:23), the family of Abdon the judge, seventy in number (Judg. 12:14), Zipporah (Ex. 4:20), the Shunammite (1 Sam. 25:30), etc. Zechariah (9:9) predicted our Lord's triumphal entrance into Jerusalem, "riding upon an ass, and upon a colt," etc. (Matt. 21:5, R.V.).

Of wild asses two species are noticed, (1) that called in Hebrew _'arod_, mentioned Job 39:5 and Dan. 5:21, noted for its swiftness; and (2) that called _pe're_, the wild ass of Asia (Job 39:6-8; 6:5; 11:12; Isa. 32:14; Jer. 2:24; 14:6, etc.). The wild ass was distinguished for its fleetness and its extreme shyness. In allusion to his mode of life, Ishmael is likened to a wild ass (Gen. 16:12. Here the word is simply rendered "wild" in the Authorized Version, but in the Revised Version, "wild-ass among men").

Source: Easton's 1897 Bible Dictionary

Just give it up, censorship never works.

CountZero

"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

  • Comment on Re: array of MySQL data for substitution

Replies are listed 'Best First'.
Re^2: array of MySQL data for substitution
by cowboy (Friar) on Mar 29, 2005 at 21:09 UTC
    I would have voted this up for the advice about being careful for false positives. (ass is the obvious example in this case), but it could have been done without the additional rant. There are many reasons one may want to filter text. And blanking out swear words many people would appreciate. The answers given here, could be useful for more than just censorship as you call it.
      <PERL FREE CONTENT FOLLOWS>

      Well, let's just say "free speech" is one of my pets.

      Free speech is so fundamental to freedom as a whole that any -and I mean ANY- censorship is the beginning of the slippery slope to dictatorship.

      CountZero

      "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

        Dictatorship occurs when you have someone who believes that they are more qualified to make all decisions, rather than the people who are actually being affected by those decisions. (you know, like those in the US Congress who think that their watching a five minute news spot means they know more about a case than judges who have been dealing with it for years.)

        Some folks who are implementing these filters are doing so because they're required to (doing it for a job, or doing it to comply with laws or other regulations.) You can say anything you want ... in your house, in public (well, okay, there are some restrictions, depending on where 'public' is, but you can say them, you'll just have to deal with repercussions from slander and whatever other laws might apply), but everyone else has the right to set their own rules on their property. To some extent, content filtering is a form of speech -- they're saying that certain words are not acceptable to them in the forum that they're controling.

        For all you know, it may be that they're not doing filtering on postings, but providing it as an optional output filter, for those users who may prefer not to see the original content if it had objectionable words.

        I'm a big fan of free speech, but I'm an even bigger fan of freedom of choice -- and a person can choose to go somewhere else if they don't agree with the rules in a particular (virtual|physical) location. I'm personally planning on establishing up my own country, on my path to world conquest, so I can get away from other people's stupid rules, and set up my own stupid rules. (there's a few gaps in the plan still, like finding and/or making a country, but I'm working on it)

Re^2: array of MySQL data for substitution
by coldfingertips (Pilgrim) on Mar 29, 2005 at 21:37 UTC
    I disagree totally that censorship never works. Who are you to say this when you don't know the environment in which I am trying to censor? What if this was a chat system or guestbook for an elementary school web page? Would it be acceptable to allow the word ass?

    I think not. If it's a business site I don't see how the word "ass" would ever come into play. And what about asshole? This should be blocked because no matter how you argue it, this is a swear word.

    Same with the word fuck and shit, business sites or school sites shouldn't allow this. Are you upset with my fucking swearing? I only bring this up because someone wants this node deleted because you don't believe that swear words should be fucking censored.

    No, I'm not mad. I'm just simply saying swear words are ACCEPTABLE to be censored but NOT acceptable to be said in most circumstances. And who are you to say what I can and cannot sensor on my web site? Isn't that sensoring what I'm trying to say or do?

    I asked a question and most posters were nice enough to post solutions to the problem. There's always that one rotten apple in the bunch.

      You can do on your website whatever you like. I don't mind.

      If I don't like your website or you attitude, I just don't visit it. I'm not at all disturbed by swearwords, but that is just me. Other people might get very upset by swearwords (for whatever definition of "swearwords") and other*other people might get even more upset by censorship of swearwords: to everyone their own I'd say.

      But the only way your swearword filter is going to work is by including a dictionary of all known swearwords in all languages and I'm afraid such dictionary has not yet been compiled.

      And please, don't call me a rotten apple. If you were not so blinded by the swearword issue, you would have noticed I was one of the first to post a solution to your problem.

      CountZero

      "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

Re^2: array of MySQL data for substitution
by gellyfish (Monsignor) on Mar 30, 2005 at 12:28 UTC