Class RelationshipFinder
java.lang.Object
net.didion.jwnl.data.relationship.RelationshipFinder
-
Method Summary
Modifier and TypeMethodDescriptionfindRelationships(Synset sourceSynset, Synset targetSynset, PointerType type) Find all relationships of type type between sourceSynset and targetSynset.findRelationships(Synset sourceSynset, Synset targetSynset, PointerType type, int depth) Find all relationships of type type between sourceSynset and targetSynset to depth depth.intgetImmediateRelationship(IndexWord sourceWord, IndexWord targetWord) Looks at whether the target word is one of the words in one of the synsets of the source word.static RelationshipFinder
-
Method Details
-
getInstance
-
getImmediateRelationship
public int getImmediateRelationship(IndexWord sourceWord, IndexWord targetWord) throws JWNLException Looks at whether the target word is one of the words in one of the synsets of the source word.- Returns:
- int the sense of the source word that contains the target word
- Throws:
JWNLException
-
findRelationships
public RelationshipList findRelationships(Synset sourceSynset, Synset targetSynset, PointerType type) throws JWNLException Find all relationships of type type between sourceSynset and targetSynset. This method creates a symmetric or asymmetric relationship based on whether type is symmetric.- Throws:
JWNLException
-
findRelationships
public RelationshipList findRelationships(Synset sourceSynset, Synset targetSynset, PointerType type, int depth) throws JWNLException Find all relationships of type type between sourceSynset and targetSynset to depth depth. This method creates a symmetric or asymmetric relationship based on whether type is symmetric.- Throws:
JWNLException
-