- Expose comicChars as a static function

This commit is contained in:
Mark Johnson
2012-06-11 11:18:43 -07:00
parent 571f4c5f25
commit 83e94c122d
@@ -38,6 +38,20 @@ public abstract class CurseFilter implements ChatFilter
/** Indicates how messages should be handled. */
public enum Mode { DROP, COMIC, VERNACULAR, UNFILTERED; }
/**
* Return a comicy replacement of the specified length.
*/
public static String comicChars (int length)
{
StringBuilder buf = new StringBuilder();
for (int ii=0; ii < length; ii++) {
buf.append(RandomUtil.pickRandom(COMIC_CHARS));
}
return buf.toString();
}
/**
* Creates a curse filter. The curse words should be a string in the following format:
*
@@ -220,19 +234,6 @@ public abstract class CurseFilter implements ChatFilter
return "\\b" + word.replace("*", "[A-Za-z]*") + "\\b";
}
/**
* Return a comicy replacement of the specified length.
*/
protected String comicChars (int length)
{
StringBuilder buf = new StringBuilder();
for (int ii=0; ii < length; ii++) {
buf.append(RandomUtil.pickRandom(COMIC_CHARS));
}
return buf.toString();
}
/** A matcher that will always cause a message to be dropped if it matches. */
protected Matcher _stopMatcher;