|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.washington.cs.knowitall.rule.Rule
public class Rule
An expression that represents a mapping from extractions to ontological relations. When evaluated against an extraction, a rule may result in an ontological relation.
| Field Summary | |
|---|---|
edu.washington.cs.knowitall.commonlib.ArraySet<Constraint> |
constraints
|
OntologicalForm |
form
|
static org.slf4j.Logger |
logger
|
Rule |
parent
|
| Constructor Summary | |
|---|---|
Rule(OntologicalForm ontology)
Constructs a new rule that maps onto the specified ontological form without additional constraints. |
|
Rule(OntologicalForm ontology,
Collection<Constraint> additionalConstraints)
|
|
Rule(Rule parent,
OntologicalForm ontology,
Collection<Constraint> additionalConstraints)
Constructs a new rule that maps onto the specified ontological form when all constraints are met. |
|
| Method Summary | |
|---|---|
OntologicalRelation |
apply(RelationExtraction extraction)
Apply this rule to the supplied extraction and return the resulting ontological relation. |
Iterable<Constraint> |
argumentConstraints()
Retrieve the constraints that are in the arguments. |
Rule |
baseRule()
Recursively finds the highest parent of this rule. |
boolean |
check(Annotation annotation)
Checks that this rule yields the supplied annotation when applied to the appropriate annotation's extraction. |
boolean |
check(RelationExtraction extraction)
Checks that this rule applied to the supplied extraction yields an ontological relation. |
Iterable<Constraint> |
constraints(ExtractionPart part)
Retrieve the constraints on the specified relation part. |
int |
constraintSize()
Return the size of the constraints. |
String |
constraintsToMultilineString()
|
boolean |
equals(Object other)
|
Iterable<Annotation> |
filterAnnotations(List<Annotation> annotations)
Filters the annotations by those that check against this rule. |
Iterable<RelationExtraction> |
filterExtractions(Iterable<RelationExtraction> extractions)
|
static List<Rule> |
fromXmlDocument(org.jdom.Document document)
|
static Rule |
fromXmlElement(org.jdom.Element e)
|
List<Rule> |
generalize()
Returns a list of all the rules that are generalized by removing a single constraint (reducing the constraint size by 1). |
int |
hashCode()
|
static void |
main(String[] args)
|
Rule |
simplify()
Simplify the rule by removing constraints that are subsumed by another constraint or an argument constraint. |
Rule |
simplifySubsumptions()
|
void |
test(com.google.common.collect.Multimap<Sentence,Annotation> annotationMap)
|
String |
toMultilineString()
|
String |
toMultilineXMLString()
Pretty formatted XML output. |
String |
toString()
Returns a single line XML representation of this rule. |
static org.jdom.Document |
toXmlDocument(Iterable<Rule> rules)
|
org.jdom.Element |
toXmlElement()
|
String |
toXMLString()
XML output. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final org.slf4j.Logger logger
public final edu.washington.cs.knowitall.commonlib.ArraySet<Constraint> constraints
public final OntologicalForm form
public final Rule parent
| Constructor Detail |
|---|
public Rule(Rule parent,
OntologicalForm ontology,
Collection<Constraint> additionalConstraints)
ontology - additionalConstraints -
public Rule(OntologicalForm ontology,
Collection<Constraint> additionalConstraints)
public Rule(OntologicalForm ontology)
ontology - | Method Detail |
|---|
public String toString()
toString in class Objectpublic int hashCode()
hashCode in class Objectpublic boolean equals(Object other)
equals in class Objectpublic String toMultilineString()
public String constraintsToMultilineString()
public String toMultilineXMLString()
public String toXMLString()
public Rule baseRule()
public Iterable<Constraint> constraints(ExtractionPart part)
part -
public Iterable<Constraint> argumentConstraints()
public int constraintSize()
public boolean check(Annotation annotation)
public boolean check(RelationExtraction extraction)
extraction -
public void test(com.google.common.collect.Multimap<Sentence,Annotation> annotationMap)
public Iterable<Annotation> filterAnnotations(List<Annotation> annotations)
annotations -
public Iterable<RelationExtraction> filterExtractions(Iterable<RelationExtraction> extractions)
public OntologicalRelation apply(RelationExtraction extraction)
extraction -
public Rule simplifySubsumptions()
public Rule simplify()
public List<Rule> generalize()
public static List<Rule> fromXmlDocument(org.jdom.Document document)
public static org.jdom.Document toXmlDocument(Iterable<Rule> rules)
public static Rule fromXmlElement(org.jdom.Element e)
public org.jdom.Element toXmlElement()
public static void main(String[] args)
throws org.jdom.JDOMException,
IOException
org.jdom.JDOMException
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||