edu.stanford.nlp.trees.semgraph
Class SemanticGraphEdge
java.lang.Object
edu.stanford.nlp.trees.semgraph.SemanticGraphEdge
- All Implemented Interfaces:
- Serializable, Comparable<SemanticGraphEdge>
public class SemanticGraphEdge
- extends Object
- implements Comparable<SemanticGraphEdge>, 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
printOnlyRelation
public static boolean printOnlyRelation
SemanticGraphEdge
public SemanticGraphEdge(IndexedWord source,
IndexedWord target,
GrammaticalRelation relation,
double weight)
SemanticGraphEdge
public SemanticGraphEdge(SemanticGraphEdge e)
toString
public String toString()
- Overrides:
toString
in class 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 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 Comparable<SemanticGraphEdge>
- Parameters:
other
- Edge to compare to
- Returns:
- Whether this is smaller, same, or larger
equals
public boolean equals(Object o)
- Overrides:
equals
in class Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
Stanford NLP Group