net.sf.extjwnl.data.relationship
Class AsymmetricRelationship
java.lang.Object
net.sf.extjwnl.data.relationship.Relationship
net.sf.extjwnl.data.relationship.AsymmetricRelationship
public class AsymmetricRelationship
- extends Relationship
An asymmetric relationship is one whose source and target synsets have lineages with a definite divergence point.
The commonParentIndex is the index of the node in the relationship that represents this divergence point.
For example, in finding a hypernym relationship between dog and cat, the relationship is dog -> canine ->
carnivore -> feline -> cat. The ancestry of "dog" and the ancestry of "cat" diverge at "carnivore," so
the common parent index is thus 2.
- Author:
- John Didion , Aliaksandr Autayeu
AsymmetricRelationship
public AsymmetricRelationship(PointerType type,
PointerTargetNodeList nodes,
int commonParentIndex,
Synset sourceSynset,
Synset targetSynset)
getCommonParentIndex
public int getCommonParentIndex()
getRelativeTargetDepth
public int getRelativeTargetDepth()
- Returns the depth of the target, from the commonParentIndex, relative to the depth of the source.
If both target and source are equidistant from the commonParentIndex, this method returns 0;
- Returns:
- the depth of the target, from the commonParentIndex, relative to the depth of the source
reverse
public Relationship reverse()
throws CloneNotSupportedException
- Specified by:
reverse
in class Relationship
- Throws:
CloneNotSupportedException
Copyright © 2011. All Rights Reserved.