edu.stanford.nlp.trees.semgraph
Class SemanticGraphEdge
java.lang.Object
edu.stanford.nlp.trees.semgraph.SemanticGraphEdge
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Comparable<SemanticGraphEdge>
public class SemanticGraphEdge
- extends java.lang.Object
- implements java.lang.Comparable<SemanticGraphEdge>, java.io.Serializable
Represents an edge in the dependency graph. Equal only if source, target, and relation are equal.
- Author:
- Christopher Cox, Teg Grenager
- See Also:
SemanticGraph,
Serialized Form
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
printOnlyRelation
public static boolean printOnlyRelation
SemanticGraphEdge
public SemanticGraphEdge(IndexedWord source,
IndexedWord target,
GrammaticalRelation relation,
double weight)
SemanticGraphEdge
public SemanticGraphEdge(SemanticGraphEdge e)
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object
getRelation
public GrammaticalRelation getRelation()
setRelation
public void setRelation(GrammaticalRelation relation)
getSource
public IndexedWord getSource()
getGovernor
public IndexedWord getGovernor()
getTarget
public IndexedWord getTarget()
getDependent
public IndexedWord getDependent()
setWeight
public void setWeight(double weight)
getWeight
public double getWeight()
typeEquals
public boolean typeEquals(SemanticGraphEdge e)
- Returns:
- true if the edges are of the same relation type
orderByTargetComparator
public static java.util.Comparator<SemanticGraphEdge> orderByTargetComparator()
compareTo
public int compareTo(SemanticGraphEdge other)
- Compares SemanticGraphEdges.
Warning: compares on the sources, targets, and then the STRINGS of the relations.
- Specified by:
compareTo in interface java.lang.Comparable<SemanticGraphEdge>
- Parameters:
other - Edge to compare to
- Returns:
- Whether this is smaller, same, or larger
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals in class java.lang.Object
hashCode
public int hashCode()
- Overrides:
hashCode in class java.lang.Object
Stanford NLP Group