This started as an idea, that it would be funny to hear the Moose swearing, occasionally. I had envisioned a control whereby users could set the percentage chance 0 to 100%, of the moose inserting swear words into its joke phrases.
In English, there are several well-known variations of linguistic rules for where swear words can be inserted. I was initially thinking I would manually embed little XML commands inside the joke phrases, like <swear1> <swear2> <swear3> etc and have them be automatically replaced by real swear words prior to speaking by the Moose.
As an aside, the Moose already checks phrases for <gender> and will substitute different words, depending on the gender of it’s user. So extending that ability to insert swearing wasn’t going to be too difficult.
( Later, I realized that linguistic analysis of sentences could be coded to happen automatically, and the code could choose places where <swear>s could be inserted automatically. )
But now, the idea has evolved even further. The Moose is being built for infinite extendability by adding plugins. The plugins will provide new features and abilities to the Moose. Anyway, I’ve just realized that I need to provide a hook that plugins can use, to get a chance to modify ANY of the phrases, no matter what source, just prior to the phrase being sent to the speech engine.
That is, I’ve thought of <gender> and <swear> subsitutions into phrases, but its likely that more cool ideas like that will occur later, so coders of future plugins will want this ability available to them.
You know how good ideas don’t always come right away.. they usually come too late, and usually you forget them if you don’t write them down. So I’m writing it down here, in my Moose development blog, so that I’ll find it later.
What am I talking about? Here’s examples. For gender substitution, if the user is a male, a phrase “a pretty girl is in love with you”, or if the user is a female, a phrase “a cute boy is in love with you”. And if the user has chosen to not tell the Moose their gender, then “an attractive person is in love with you”. For swearing, a phrase like “Yo mamma is so fat” could automatically become “Yo mamma is so fucking fat”.
Can I think of any other future uses for this mechanism? Maybe when the Moose is translated into many other languages, different linguistic rules for swearing will need custom plugins controls.
Also, my apologies for swearing in print. I tell my kids, dont’ swear at home, don’t swear in school, don’t swear at work, but if you hang out with Bikers, then you have to swear to communicate effectively. Anyway the comedy value of this mechanism, is easily served by swear variants, like feck, fecking, frack, fracking, frick, frickin, mugger-flecking, mugger-plucking, etc.
Update April 29, 2011. Another Applet ability that I have realized that I need to add, will be a Phrase modification function for swear or profanity filtering. Because the Moose speaks things “out loud” where others in the room can hear it, any profanity in a phrase might be Not Suitable for the Office, or Not Suitable for Home.
I foresee a need to automatically change words like “fuck” into “feck, frick, frack” etc. I wrote about this in a different post about Twitter abilities for the Moose. Twitter is a fantastic source of fresh humor, but so much of it is not suitable for speaking aloud in a workplace or speaking aloud with your family hearing it. ( Yes, I want to give users the option, of having a Moose that others can overhear at work or home, or the option of letting the moose be as vulgar as the user wants in privacy.)
So in addition to creating a method for automatically blocking Tweet phrases with words on a “not suitable for the office” list, I like the idea of automatically changing other swear words into some humorous variants. So, I’m going to end up coding an awesome Profanity filter mechanism.