Class Relationship
java.lang.Object
net.didion.jwnl.data.relationship.Relationship
- Direct Known Subclasses:
AsymmetricRelationship, SymmetricRelationship
A
Relationship encapsulates the relationship between two synsets. Basically, it is a list of
synsets/words that one must traverse to get from the source synset to the target synset of the
relationship, for some relationship type.
There are two types of relationships - Symmetric
and Asymmetric.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate PointerTargetNodeListThe nodes that comprise the relationship.private Synsetprivate Synsetprivate PointerTypeThe relationship's type -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedRelationship(PointerType type, PointerTargetNodeList nodes, Synset sourceSynset, Synset targetSynset) -
Method Summary
Modifier and TypeMethodDescriptionbooleanTwo relationships are assumed equal if they have the same source synset, target synset, and typeintgetDepth()Get the depth of this relationship.Get the list that contains the nodes of this relationship.intgetSize()Get the pointer target of the source node.Get the Synset that is the source of this relationship.Get the pointer target of the target node.Get the Synset that is the target of this relationship.getType()abstract Relationshipreverse()toString()
-
Field Details
-
_nodes
The nodes that comprise the relationship. -
_type
The relationship's type -
_sourceSynset
-
_targetSynset
-
-
Constructor Details
-
Relationship
protected Relationship(PointerType type, PointerTargetNodeList nodes, Synset sourceSynset, Synset targetSynset)
-
-
Method Details
-
reverse
-
getNodeList
Get the list that contains the nodes of this relationship. -
getSourcePointerTarget
Get the pointer target of the source node. -
getTargetPointerTarget
Get the pointer target of the target node. -
toString
-
equals
-
getType
-
getSourceSynset
Get the Synset that is the source of this relationship. -
getTargetSynset
Get the Synset that is the target of this relationship. -
getSize
public int getSize() -
getDepth
public int getDepth()Get the depth of this relationship. Depth is a concept that can be defined by each relationship type. The default notion of depth is the number of pointers that need to be traversed to go from the source to target synset. This is basically getSize() - 1.
-