|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.washington.cs.knowitall.rule.constraint.Constraint
public abstract class Constraint
A representation of a rule constraint. A rule constraint is applied to an extraction and yields true if it passes.
| Field Summary | |
|---|---|
ExtractionPart |
part
|
| Constructor Summary | |
|---|---|
protected |
Constraint(org.jdom.Element e)
Common deserialization from an element. |
|
Constraint(ExtractionPart part)
Constructs a new constraint on the specified extraction part. |
| Method Summary | |
|---|---|
Boolean |
check(RelationExtraction extraction)
Check the constraint against the supplied extraction. |
protected abstract Boolean |
check(TokenSequence extraction)
|
static Constraint |
create(Class<?> tagger,
Class<?>[] argTypes,
Object[] argValues)
|
static Constraint |
create(String classname)
|
static Constraint |
create(String classname,
Class<?>[] argTypes,
Object[] argValues)
|
boolean |
equals(Object other)
Force subclasses to avoid pointer-based comparison. |
static Constraint |
fromXmlElement(org.jdom.Element e)
|
abstract List<Constraint> |
generalize()
Creates a list of constraints with constraint size reduced by exactly one. |
static Class<?> |
getConstraintClass(String classname)
|
int |
hashCode()
Force subclasses to avoid pointer-based comparison. |
Constraint |
simplify()
Simplifies a constraint. |
abstract int |
size()
The size of a constraint is the count of subconstraints. |
boolean |
subsumes(Constraint other)
Checks is a constraint is weakly stricter than the other. |
String |
toString()
Provides a base constraint representation. |
String |
toString(Iterable<?> args)
Combines arguments into a common constraint representation. |
String |
toString(String arg)
Combines the argument into a common constraint representation. |
org.jdom.Element |
toXmlElement()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public final ExtractionPart part
| Constructor Detail |
|---|
protected Constraint(org.jdom.Element e)
e - public Constraint(ExtractionPart part)
part - | Method Detail |
|---|
public Boolean check(RelationExtraction extraction)
relation -
public boolean equals(Object other)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic String toString()
toString in class Objectargs -
public String toString(String arg)
args -
public String toString(Iterable<?> args)
args -
protected abstract Boolean check(TokenSequence extraction)
extraction -
public abstract int size()
TermConstraint
for example has a size equal to the number of restrictions it has.
public abstract List<Constraint> generalize()
public boolean subsumes(Constraint other)
other - constraint to compare against
public Constraint simplify()
public static Class<?> getConstraintClass(String classname)
throws ClassNotFoundException
ClassNotFoundException
public static Constraint create(String classname,
Class<?>[] argTypes,
Object[] argValues)
throws ClassNotFoundException,
SecurityException,
IllegalArgumentException,
NoSuchMethodException,
InstantiationException,
IllegalAccessException,
InvocationTargetException
ClassNotFoundException
SecurityException
IllegalArgumentException
NoSuchMethodException
InstantiationException
IllegalAccessException
InvocationTargetException
public static Constraint create(Class<?> tagger,
Class<?>[] argTypes,
Object[] argValues)
throws SecurityException,
NoSuchMethodException,
IllegalArgumentException,
InstantiationException,
IllegalAccessException,
InvocationTargetException
SecurityException
NoSuchMethodException
IllegalArgumentException
InstantiationException
IllegalAccessException
InvocationTargetException
public static Constraint create(String classname)
throws ClassNotFoundException,
SecurityException,
IllegalArgumentException,
NoSuchMethodException,
InstantiationException,
IllegalAccessException,
InvocationTargetException
ClassNotFoundException
SecurityException
IllegalArgumentException
NoSuchMethodException
InstantiationException
IllegalAccessException
InvocationTargetExceptionpublic static Constraint fromXmlElement(org.jdom.Element e)
public org.jdom.Element toXmlElement()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||