org.alicebot.server.core.util
Class InputNormalizer

java.lang.Object
  extended by org.alicebot.server.core.util.InputNormalizer

public class InputNormalizer
extends java.lang.Object

InputNormalizer replaces Substituter as the utility class for performing various stages of input normalization. Substitutions of other types are now handled independently by their respective processors.

Since:
4.1.3

Constructor Summary
InputNormalizer()
           
 
Method Summary
static java.lang.String patternFit(java.lang.String input)
           Performs pattern-fitting normalization on an input.
static java.lang.String patternFitIgnoreCase(java.lang.String input)
           Performs a partial pattern-fitting normalization on an input -- partial because it does not convert letters to uppercase.
static java.util.ArrayList sentenceSplit(java.util.ArrayList sentenceSplitters, java.lang.String input)
          Splits an input into sentences, as defined by the #sentenceSplitterList.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InputNormalizer

public InputNormalizer()
Method Detail

sentenceSplit

public static java.util.ArrayList sentenceSplit(java.util.ArrayList sentenceSplitters,
                                                java.lang.String input)
Splits an input into sentences, as defined by the #sentenceSplitterList.

Parameters:
input - the input to split
Returns:
the input split into sentences

patternFit

public static java.lang.String patternFit(java.lang.String input)

Performs pattern-fitting normalization on an input.

This is best used to produce a caseless representation of the effective match string when presenting match results to a user; however, if used when actually performing the match it will result in the case of wildcard-captured values being lost. Some amendment of the specification is probably in order.

Parameters:
input - the string to pattern-fit
Returns:
the pattern-fitted input

patternFitIgnoreCase

public static java.lang.String patternFitIgnoreCase(java.lang.String input)

Performs a partial pattern-fitting normalization on an input -- partial because it does not convert letters to uppercase.

This is used when sending patterns to the Graphmaster so that wildcard contents can be captured and case retained. Some amendment of the specification is probably in order.

Parameters:
input - the string to pattern-fit
Returns:
the pattern-fitted input