var
list
// Filters
profanityfix = list("Z","Y","X","W","V","U","T","S","R","Q","P","O","N","M" ,"L","K","J","I","H","G","F","E","D","C","B","A") // Add words that should be filtered here
profanity = list("A","B","C","D","E","F","G","H","I","J","K","L","M","N" ,"O","P","Q","R","S","T","U","V","W","X","Y","Z") // Add replacements to the filtered words
profanity2 = list("Z","Y","X","W","V","U","T","S","R","Q","P","O","N","M" ,"L","K","J","I","H","G","F","E","D","C","B","A") // Add words that should be filtered here
profanityfix2 = list("A","B","C","D","E","F","G","H","I","J","K","L","M","N" ,"O","P","Q","R","S","T","U","V","W","X","Y","Z") // Add replacements to the filtered words
// Note: Filtered words that may be found in safe words(ex. ass/class) should have a space before
// otherwise it filters class into cl*** and assets into ***ets
proc
/*
Use: scantext(textstring)
Returns a filtered text string
This is a fairly standard way to do it, there are probably more efficient ways out there but this works for me
*/
scantext(m as text)
var/p
m = " " + copytext(m,1) + " "
// Profanity fixes
// Scan through each of the words found in the profanity list and replace them
// More checks can be added, see demo file for emoticons and slangs
if(profanity.len)
for(var/i=1,i<=profanity.len,i++)
p = findtext(m,profanity[i])
while(p)
m = copytext(m,1,p) + profanityfix[i] + copytext(m,p+length(profanity[i]))
p = findtext(m,profanity[i])
return m
mob
verb
English_To_Blab(message as text) // Generic say verb
src << "[src.name]: [wordfilter(message)]"
Blab_To_English(message as text) // Generic say verb
src << "[src.name]: [wordfilter2(message)]"
/***********************************/
/* Customized System of the libary */
/***********************************/
/*
This is what you'll probably want to do with this libary, add in more filters such as slang and emoticons
I have copied the original proc(with only profanity filter) and added in slang, which is similar to
the profanity, so it only needs to be copied.
Emoticons filter the text into an icon_state that will be displayed
You'll probably want to change the proc name to suit your needs.
*/
proc
wordfilter(m as text)
var/p
m = " " + copytext(m,1) + " "
// Profanity
if(profanity.len)
for(var/i=1,i<=profanity.len,i++)
p = findtext(m,profanity[i])
while(p)
m = copytext(m,1,p) + profanityfix[i] + copytext(m,p+length(profanity[i]))
p = findtext(m,profanity[i])
return m
wordfilter2(m as text)
var/p
m = " " + copytext(m,1) + " "
// Profanity
if(profanity2.len)
for(var/i=1,i<=profanity2.len,i++)
p = findtext(m,profanity2[i])
while(p)
m = copytext(m,1,p) + profanityfix2[i] + copytext(m,p+length(profanity2[i]))
p = findtext(m,profanity2[i])
return m
here's my translater.
EXAMPLE
HI SIR > ENGLISH TO BLAB > HI HII
HI HII > BLAB TO ENGLISH > SR SRR
SEE THE PROBLEM?
ID:147604
![]() Mar 11 2004, 12:27 am
|
|