edu.washington.cs.knowitall.rule.constraint
Class AbstractPatternConstraint

java.lang.Object
  extended by edu.washington.cs.knowitall.rule.constraint.Constraint
      extended by edu.washington.cs.knowitall.rule.constraint.CaptureConstraint
          extended by edu.washington.cs.knowitall.rule.constraint.AbstractPatternConstraint
Direct Known Subclasses:
PatternConstraint, TermConstraint

public abstract class AbstractPatternConstraint
extends CaptureConstraint

] Parent class that contains common functionality for a constraint that is expressible using a token-based pattern.

Author:
schmmd

Field Summary
protected  edu.washington.cs.knowitall.commonlib.regex.RegularExpression<Token> expression
           
 
Fields inherited from class edu.washington.cs.knowitall.rule.constraint.Constraint
part
 
Constructor Summary
  AbstractPatternConstraint(org.jdom.Element e)
           
protected AbstractPatternConstraint(org.jdom.Element e, ExtractionPart part)
           
  AbstractPatternConstraint(ExtractionPart part, String pattern)
           
 
Method Summary
protected  Boolean check(TokenSequence extraction)
          Evaluates this constraint against a token sequence using the underlying token-based regular expression.
protected  String deserializePattern(org.jdom.Element e)
          Constructs a pattern expression from an element.
 boolean equals(Object other)
          Force subclasses to avoid pointer-based comparison.
protected  String getString(TokenSequence extraction)
           
protected  String value(TokenSequence extraction)
          Evaluates this constraint against a token sequence using the underlying token-based regular expression.
 
Methods inherited from class edu.washington.cs.knowitall.rule.constraint.CaptureConstraint
value
 
Methods inherited from class edu.washington.cs.knowitall.rule.constraint.Constraint
check, create, create, create, fromXmlElement, generalize, getConstraintClass, hashCode, simplify, size, subsumes, toString, toString, toString, toXmlElement
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

expression

protected final edu.washington.cs.knowitall.commonlib.regex.RegularExpression<Token> expression
Constructor Detail

AbstractPatternConstraint

public AbstractPatternConstraint(org.jdom.Element e)

AbstractPatternConstraint

public AbstractPatternConstraint(ExtractionPart part,
                                 String pattern)

AbstractPatternConstraint

protected AbstractPatternConstraint(org.jdom.Element e,
                                    ExtractionPart part)
Method Detail

equals

public boolean equals(Object other)
Description copied from class: Constraint
Force subclasses to avoid pointer-based comparison.

Overrides:
equals in class Constraint

deserializePattern

protected String deserializePattern(org.jdom.Element e)
Constructs a pattern expression from an element.

Parameters:
e -
Returns:

check

protected Boolean check(TokenSequence extraction)
Evaluates this constraint against a token sequence using the underlying token-based regular expression.

Specified by:
check in class Constraint
Returns:
true if the pattern matches

value

protected String value(TokenSequence extraction)
Evaluates this constraint against a token sequence using the underlying token-based regular expression.

Specified by:
value in class CaptureConstraint
Returns:
the matching string, or null

getString

protected String getString(TokenSequence extraction)
Parameters:
extraction -
Returns:
the string to match the pattern against


Copyright © 2011 University of Washington CSE. All Rights Reserved.