org.alicebot.server.core.processor
Class GenderProcessor

java.lang.Object
  extended by org.alicebot.server.core.processor.Processor
      extended by org.alicebot.server.core.processor.AIMLProcessor
          extended by org.alicebot.server.core.processor.GenderProcessor

public class GenderProcessor
extends AIMLProcessor

Handles a gender element.

Currently does not permit definition of gender substitutions in an external file (they are hard-coded in Substituter#gender.

Version:
4.1.3
Author:
Jon Baer, Thomas Ringate, Pedro Colla

Field Summary
static java.lang.String label
           
 
Fields inherited from class org.alicebot.server.core.processor.Processor
EMPTY_STRING, ENABLED, ID, NAME, NAME_EQUALS, VALUE, VALUE_EQUALS
 
Constructor Summary
GenderProcessor()
           
 
Method Summary
static void addSubstitution(java.lang.String find, java.lang.String replace)
          Adds a substitution to the substitutions map.
static java.lang.String applySubstitutions(java.lang.String input, java.lang.String botid)
          Applies substitutions as defined in the substitutionMap.
 java.lang.String process(int level, XMLNode tag, TemplateParser parser)
           
 
Methods inherited from class org.alicebot.server.core.processor.AIMLProcessor
process
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

label

public static final java.lang.String label
See Also:
Constant Field Values
Constructor Detail

GenderProcessor

public GenderProcessor()
Method Detail

process

public java.lang.String process(int level,
                                XMLNode tag,
                                TemplateParser parser)
                         throws AIMLProcessorException
Specified by:
process in class AIMLProcessor
Throws:
AIMLProcessorException

applySubstitutions

public static java.lang.String applySubstitutions(java.lang.String input,
                                                  java.lang.String botid)
Applies substitutions as defined in the substitutionMap. Comparisons are case-insensitive.

Parameters:
input - the input on which to perform substitutions
Returns:
the input with substitutions performed

addSubstitution

public static void addSubstitution(java.lang.String find,
                                   java.lang.String replace)
Adds a substitution to the substitutions map. The find parameter is stored in uppercase, to do case-insensitive comparisons. The replace parameter is stored as is.

Parameters:
find - the string to find in the input
replace - the string with which to replace the found string