edu.stanford.nlp.semgraph
Class SemanticGraphEdge
java.lang.Object
edu.stanford.nlp.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,
boolean isExtra)
- Parameters:
source
- The source IndexedWord for this edgetarget
- The target IndexedWord for this edgerelation
- The relation between the two words represented by this edgeweight
- A score or weight to attach to the edge (not often used)isExtra
- Whether or not the dependency this edge represents was "extra"
SemanticGraphEdge
public SemanticGraphEdge(SemanticGraphEdge e)
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
getRelation
public GrammaticalRelation getRelation()
getSource
public IndexedWord getSource()
getGovernor
public IndexedWord getGovernor()
getTarget
public IndexedWord getTarget()
getDependent
public IndexedWord getDependent()
getWeight
public double getWeight()
isExtra
public boolean isExtra()
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