rita.support
Class RegexRule

java.lang.Object
  extended by rita.support.RegexRule

public class RegexRule
extends java.lang.Object

Adapted from the SnlgPatternRule class in the SimpleNLG package


Field Summary
static int DEFAULT
          The Constant DEFAULT.
static int EXCEPTION
          The Constant EXCEPTION.
static int GENERIC
          The Constant GENERIC.
 
Constructor Summary
RegexRule(java.lang.String regex, int truncate, java.lang.String suff)
          Instantiates a new pattern action rule.
RegexRule(java.lang.String regex, int truncate, java.lang.String suff, int notused)
          Instantiates a new pattern action rule.
 
Method Summary
 boolean analyse(java.lang.String word)
          Analyse.
 boolean applies(java.lang.String word)
          Applies.
 java.lang.String fire(java.lang.String word)
          Fire.
 java.lang.String getLeftHandSide()
          Gets the left hand side.
 java.lang.String toString()
          The type.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EXCEPTION

public static final int EXCEPTION
The Constant EXCEPTION.

See Also:
Constant Field Values

GENERIC

public static final int GENERIC
The Constant GENERIC.

See Also:
Constant Field Values

DEFAULT

public static final int DEFAULT
The Constant DEFAULT.

See Also:
Constant Field Values
Constructor Detail

RegexRule

public RegexRule(java.lang.String regex,
                 int truncate,
                 java.lang.String suff,
                 int notused)
Instantiates a new pattern action rule.

Parameters:
regex - the regex
truncate - the truncate
suff - the suff

RegexRule

public RegexRule(java.lang.String regex,
                 int truncate,
                 java.lang.String suff)
Instantiates a new pattern action rule.

Parameters:
regex - the regex
truncate - the truncate
suff - the suff
Method Detail

toString

public java.lang.String toString()
The type.

Overrides:
toString in class java.lang.Object

getLeftHandSide

public java.lang.String getLeftHandSide()
Gets the left hand side.

Returns:
the left hand side

applies

public boolean applies(java.lang.String word)
Applies.

Parameters:
word - the word
Returns:
true, if successful

fire

public java.lang.String fire(java.lang.String word)
Fire.

Parameters:
word - the word
Returns:
the string

analyse

public boolean analyse(java.lang.String word)
Analyse.

Parameters:
word - the word
Returns:
true, if successful