|
||||||||||
| 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
edu.washington.cs.knowitall.rule.constraint.CaptureConstraint
edu.washington.cs.knowitall.rule.constraint.AbstractPatternConstraint
edu.washington.cs.knowitall.rule.constraint.TermConstraint
public class TermConstraint
Constrains based on the existance of a term. A term is a range of text that matches all of the associated restrictions. Any of the following can be associated as a restriction: StringConstraint ChunkConstraint TypeConstraint LemmaConstraint
| Nested Class Summary | |
|---|---|
static class |
TermConstraint.ChunkRequirement
Require the associated chunk tag. |
static class |
TermConstraint.LemmaRequirement
Require the associated lemma. |
static class |
TermConstraint.PosRequirement
Require the associated POS tag. |
static class |
TermConstraint.Requirement
A subconstraint of a TermConstraint. |
static class |
TermConstraint.StringRequirement
Require the associated string. |
static class |
TermConstraint.TypeRequirement
Require the associated type. |
| Field Summary | |
|---|---|
Set<TermConstraint.Requirement> |
requirements
|
| Fields inherited from class edu.washington.cs.knowitall.rule.constraint.AbstractPatternConstraint |
|---|
expression |
| Fields inherited from class edu.washington.cs.knowitall.rule.constraint.Constraint |
|---|
part |
| Constructor Summary | |
|---|---|
|
TermConstraint(org.jdom.Element e)
|
protected |
TermConstraint(org.jdom.Element e,
ExtractionPart part)
|
|
TermConstraint(ExtractionPart part,
List<TermConstraint.Requirement> requirements)
|
|
TermConstraint(ExtractionPart part,
TermConstraint.Requirement requirement)
|
| Method Summary | |
|---|---|
protected static String |
buildPattern(List<TermConstraint.Requirement> requirements)
Build a pattern from the list of requirements. |
protected String |
deserializePattern(org.jdom.Element e)
Deserialize the sequence of term constraints in the XML element into a token-based pattern. |
boolean |
equals(Object other)
Force subclasses to avoid pointer-based comparison. |
List<Constraint> |
generalize()
Generalize by removing a subconstraint. |
int |
hashCode()
Force subclasses to avoid pointer-based comparison. |
String |
pattern()
|
Constraint |
simplify()
If there are no constraints, this constraint may be removed. |
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. |
org.jdom.Element |
toSubsequenceXmlElement()
|
org.jdom.Element |
toXmlElement()
|
| Methods inherited from class edu.washington.cs.knowitall.rule.constraint.AbstractPatternConstraint |
|---|
check, getString, value |
| 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, getConstraintClass, toString, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public final Set<TermConstraint.Requirement> requirements
| Constructor Detail |
|---|
public TermConstraint(org.jdom.Element e)
protected TermConstraint(org.jdom.Element e,
ExtractionPart part)
public TermConstraint(ExtractionPart part,
List<TermConstraint.Requirement> requirements)
public TermConstraint(ExtractionPart part,
TermConstraint.Requirement requirement)
| Method Detail |
|---|
public String toString()
Constraint
toString in class Constraintpublic boolean equals(Object other)
Constraint
equals in class AbstractPatternConstraintpublic int hashCode()
Constraint
hashCode in class Constraintpublic int size()
ConstraintTermConstraint
for example has a size equal to the number of restrictions it has.
size in class Constraintpublic String pattern()
public Constraint simplify()
simplify in class Constraintpublic boolean subsumes(Constraint other)
Constraint
subsumes in class Constraintother - constraint to compare against
public List<Constraint> generalize()
generalize in class Constraintprotected String deserializePattern(org.jdom.Element e)
deserializePattern in class AbstractPatternConstraintprotected static String buildPattern(List<TermConstraint.Requirement> requirements)
requirements -
public org.jdom.Element toXmlElement()
toXmlElement in class Constraintpublic org.jdom.Element toSubsequenceXmlElement()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||